var map = null; var geocoder = null; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); //--------------START tasti di navigazione map.addControl(new GLargeMapControl()); //Si-Zoom e spostamento grandi //map.addControl(new GSmallZoomControl()); //No-Zoom piccolo in alto sx map.addControl(new GScaleControl()); //Si-Esempio di scala //map.addControl(new GSmallMapControl()); //No-direzione e zoom piccoli map.addControl(new GMapTypeControl()); //Si-Tipologia Mappe map.addControl(new GOverviewMapControl ()); //Si-riquadro basso dx richiudibile //--------------END tasti di navigazione map.setCenter(new GLatLng(0,0),0); geocoder = new GClientGeocoder(); showAddress(3, "via Giuseppe Mazzini, 10123,Torino, Italia", "yes"); } } function showAddress(type, address, conferma) { //1=solo segnalino, 2=solo centra, 3=segnalino & centra if(geocoder){ geocoder.getLatLng( address, function(point){ if(!point){ if(conferma=="yes"){ alert(address + " Non Trovato Verrai Reindirizzato Su Torino"); showAddress(2, "Torino, Italia", "no"); }else{ alert("Spiacenti: problemi tecnici per la Localizzazione "); } }else{ if(type==2 || type==3){ map.setCenter(point, 13); }if(type==1 || type==3) map.addOverlay(createMarker(point, ""));//questo richiama il marker } } ); } } //--------------START Nostra Icona var 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); //--------------END Nostra Icona function createMarker(point, number) { var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function() { var infoTabs = [ //START CON TAB new GInfoWindowTab("Indirizzo ", "Amazeing Friends
via Giuseppe Mazzini 40
10123
Torino
"), new GInfoWindowTab("Note ", "Presso la Galleria Maze esposizione delle opere di: Sasdane Afif, Don Bury, Juan Céspedes, Ethan Crenson, Jessica Craig Martin, Nathalie Djurberg, Flavio Favelli, Peter Geschwind, Piero Golia, Lise Harlev, Henrik Plenge Jakobsen, Jesper Just, Scott King, Sandrine Nicoletta, Giuseppe Pietroniro, Paul Pfeiffer, Tere Recarens, Peter Rostvosky, Katrin Sigurdardóttir, Pablo Vargas Lugo, Mark Wallinger, Richard Woods.") ]; marker.openInfoWindowTabsHtml(infoTabs); //END CON TAB //marker.openInfoWindowHtml("" + number + " Casina bella nico
Via Ranà"); //SENZA TAB }); return marker; }