Ciao,
ho implementato questo codice ma non riesco a far apparire il marker.. non capisco il perchè?![]()
Grazie in anticipocodice:<script src="http://maps.google.com/maps?file=api&v=2.x&key=LA_MIA_CHIAVE" type="text/javascript"></script> <script type="text/javascript"> var map = null; var geocoder = null; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(42.924335 , 10.755349), 17); geocoder = new GClientGeocoder(); } } function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 16); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(address); } } ); } } </script> <body onLoad="load();showAddress('Largo Manzoni 9, 58022 Follonica (GR), Italy');" onUnload="GUnload();"> <div id="map" style="width: 500px; height: 300px"></div> </body>![]()
![]()

Rispondi quotando