function load(){ if(GBrowserIsCompatible()){ var map = new GMap2(document.getElementById("mappa")); var mapTypeControl = new GSmallMapControl(); var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10)); var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)); map.addControl(mapTypeControl, bottomRight); GEvent.addListener(map, "dblclick", function() { map.removeControl(mapTypeControl); map.addControl(new GSmallMapControl(), bottomRight); }); map.addControl(new GMapTypeControl(1)); map.setCenter(new GLatLng( 42.966425,10.646675), 9); map.setMapType(G_PHYSICAL_MAP); map.enableContinuousZoom(); map.enableDoubleClickZoom(); icon = new GIcon(); icon.image = "/immagini/rosso.png"; icon.iconSize = new GSize(44, 39); icon.iconAnchor = new GPoint(18, 40); icon.infoWindowAnchor = new GPoint(5, 1); iconb = new GIcon(); iconb.image = "/immagini/verde.png"; iconb.iconSize = new GSize(63, 56); iconb.iconAnchor = new GPoint(18, 50); iconb.infoWindowAnchor = new GPoint(5, 1); function createMarker(point, icon, notes){ var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function(){ marker.openInfoWindowHtml(notes); }); return marker; } GEvent.addListener(map, "moveend", function() { var center = map.getCenter(); }); GEvent.addListener(map, "zoomend", function() { var zoom = map.getZoom(); }); GEvent.addListener(map, "maptypechanged", function() { var mode = map.getCurrentMapType().getName(); }); var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); var point=new GLatLng(42.966425,10.646675); map.addOverlay(createMarker(point, iconb, '
Villaggio Turistico Airone
')); var point=new GLatLng(42.909019,10.850567); map.addOverlay(createMarker(point, icon, '
Scarlino - Cala Violina
Scarlino - Cala Violina
')); var geoXml31; geoXml31 = new GGeoXml("http://villaggioturisticoairone.com/kml/scarlino_-_cala_violina.kml"); //GEvent.addListener(geoXml31, 'click', function() { // When clicked, open an Info Window // geoXml31.openInfoWindowHtml('Some text'); // }); map.addOverlay(geoXml31); }}//]]>