Jump to content
php.lv forumi

Vajag JS kodera palīdzību


Uldis

Recommended Posts

Izmantoju googles vizualizācijas skriptu, bet nemāku dabūt klāt iespēju, ka var uzklikšķinot uz kartes tikt kādā lapā, piem., noklikšķinot kartē uz Liepājas - > nonākt http://www.liepaja.lv

 

Zemāk pievienoju kodu :

 

<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>

Edited by Uldis
Link to comment
Share on other sites

šim it kā būtu jāstrādā

 

 

regionClick

 

Called when a region is clicked. Works both for 'regions' and 'markers' dataMode. However, in marker mode, this will not be thrown for the specific country assigned in the 'region' option (if a specific country was listed).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...