Skip to content

Instantly share code, notes, and snippets.

@mepcotterell
Created March 26, 2012 15:51
Show Gist options
  • Save mepcotterell/2206103 to your computer and use it in GitHub Desktop.
Save mepcotterell/2206103 to your computer and use it in GitHub Desktop.
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawMarkersMap);
function drawMarkersMap() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'City');
data.addColumn('number', 'Population');
data.addColumn('number', 'Area');
data.addRows([
['Rome', 2761477, 1285.31],
['Milan', 1324110, 181.76],
['Naples', 959574, 117.27],
['Turin', 907563, 130.17],
['Palermo', 655875, 158.9],
['Genoa', 607906, 243.60],
['Bologna', 380181, 140.7],
['Florence', 371282, 102.41]
]);
var options = {
region: 'IT',
displayMode: 'markers',
colorAxis: {colors: ['green', 'blue']}
};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment