Uldis Posted July 28, 2010 Report Share Posted July 28, 2010 (edited) 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 July 28, 2010 by Uldis Quote Link to comment Share on other sites More sharing options...
codez Posted July 28, 2010 Report Share Posted July 28, 2010 Sāc taču likt vienreiz kodus code tagos, ja gribi, lai kāds tavu kodu lasa. Quote Link to comment Share on other sites More sharing options...
Uldis Posted July 28, 2010 Author Report Share Posted July 28, 2010 Ieteikums ņemts vērā. Quote Link to comment Share on other sites More sharing options...
codez Posted July 28, 2010 Report Share Posted July 28, 2010 Šķiet, ka tas nav iespējams, jo vienīgie eventi, ko met arā tas API, ir spiežot uz reģioniem, bet nekādi uz marķieriem. Quote Link to comment Share on other sites More sharing options...
Uldis Posted July 28, 2010 Author Report Share Posted July 28, 2010 š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). Quote Link to comment Share on other sites More sharing options...
codez Posted July 28, 2010 Report Share Posted July 28, 2010 "Works both for 'regions' and 'markers' dataMode." nozīmē, ka strādā tādās modēs, nevis uz tiem objektiem. Quote Link to comment Share on other sites More sharing options...
Uldis Posted July 28, 2010 Author Report Share Posted July 28, 2010 Skaidrs, tad jāmeklē kāds cits risinājums kā dabūt uz kartes virsū pilsētas ar cipariem Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.