function load(){ if(GBrowserIsCompatible()){ var map = new GMap2(document.getElementById("map")); var mapTypeControl = new GSmallZoomControl3D() ; 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.setCenter(new GLatLng(43.8686, 10.3407), 13); map.setMapType(G_HYBRID_MAP); map.enableContinuousZoom(); map.enableDoubleClickZoom(); icon = new GIcon(); icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); iconb = new GIcon(); iconb.image = "http://labs.google.com/ridefinder/images/mm_20_green.png"; iconb.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; iconb.iconSize = new GSize(12, 20); iconb.shadowSize = new GSize(22, 20); iconb.iconAnchor = new GPoint(6, 20); iconb.infoWindowAnchor = new GPoint(5, 1); iconc = new GIcon(); iconc.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png"; iconc.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; iconc.iconSize = new GSize(12, 20); iconc.shadowSize = new GSize(22, 20); iconc.iconAnchor = new GPoint(6, 20); iconc.infoWindowAnchor = new GPoint(5, 1); icond = new GIcon(); icond.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png"; icond.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icond.iconSize = new GSize(12, 20); icond.shadowSize = new GSize(22, 20); icond.iconAnchor = new GPoint(6, 20); icond.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(43.8686, 10.3407); map.addOverlay(createMarker(point, icond, 'Viareggio')); }}//]]>