...

View Full Version : Need JS coder help



uldisx1
07-28-2010, 03:38 PM
Hi, i need your help! I use google vizualization script, but i cant get one thing. I need get URL call function, when i click on map - > city



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geomap']});
google.setOnLoadCallback(drawMap);

function drawMap() {
var data = new google.visualization.DataTable();
data.addRows(6);
data.addColumn('string', 'City');
data.addColumn('number', 'Popularity');
data.setValue(0, 0, 'Rīga');
data.setValue(0, 1, 200);
data.setValue(1, 0, 'Liepāja');
data.setValue(1, 1, 300);
var options = {};
options['region'] = 'LV';
options['colors'] = [0xFF8747, 0xFFB581, 0xc06000]; //orange colors
options['dataMode'] = 'markers';
var container = document.getElementById('map_canvas');
var geomap = new google.visualization.GeoMap(container);
geomap.draw(data, options);
};
</script>
</head>
<body>

<div id='map_canvas'></div>

</body>
</html>

uldisx1
07-28-2010, 03:38 PM
Here you can find examples of this script - http://code.google.com/apis/visualization/documentation/gallery/geomap.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum