Visualization: Map no longer works in Safari 5.1 (Mac), OK in Chrome and FF

28 views
Skip to first unread message

Simon Banton

unread,
Aug 27, 2016, 4:50:56 PM8/27/16
to Google Visualization API
Yes, it's an old version (OS X 10.6 Snow Leopard) but Safari 5.1.10 is failing to display any of the examples at https://google-developers.appspot.com/chart/interactive/docs/gallery/map

I encountered this when trying to work out why my own code was working perfectly in Chrome and FF but failing to display in Safari - I'd thought it was something local to my setup so went back to the original Gallery examples and was surprised to encounter the same issue. I remember the examples working across all these browsers when I began my project in March this year.

The minimal implementation of my code which demonstrates the problem is online here:


... code copied in below in case anything obvious jumps out to anyone here.

<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

<script type="text/javascript">

// For this minimal example, I have removed my API key which means the Console
// will report a NoApiKeys warning.
// My actual live code uses the following two lines:
// var myMapsApiKey = 'xxxxxxxxxxxxxxx';
// google.charts.load("45", {packages:["map"], mapsApiKey:myMapsApiKey});

google.charts.load("45", {packages:["map"]});
google.charts.setOnLoadCallback(drawVisualization);
var query;
var options = {
mapType: 'satellite',
showTip: true,
useMapTypeControl: true,
};

function drawVisualization() {
query = new google.visualization.Query(
);
query.setQuery('Select A,B,I where A is not null');
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var container = document.getElementById('map_div');
var visualization = new google.visualization.Map(container);
visualization.draw(data, options);
}
</script>
</head>

<body>
<div id="map_div" style="height: 100%"></div>
</body>

</html>

Suggestions as to a fix for this non-display problem (apart than "upgrade your OS", there are reasons why that's not possible right now) would be very welcome.

Cheers
S.
Reply all
Reply to author
Forward
0 new messages