function load(){ if (GBrowserIsCompatible()) { var gmarkers = []; var htmls = []; var i = 0; // ===== Start with an empty GLatLngBounds object ===== var bounds = new GLatLngBounds(); // Create some custom icons // This icon uses the same shape as the default Google marker // So we can use its details for everything except the image var zabo= new GIcon();zabo.image = 'http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/zabot_fr.jpg'; zabo.iconSize = new GSize(33, 27); zabo.shadowSize = new GSize(37, 34); zabo.iconAnchor = new GPoint(16,27); zabo.infoWindowAnchor = new GPoint(9, 2); zabo.infoShadowAnchor = new GPoint(18, 25); // This icon is a different shape, so we need our own settings var victorino = new GIcon(); victorino.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/victorinot_fr.jpg"; victorino.iconSize = new GSize(33, 27); victorino.shadowSize = new GSize(36, 34); victorino.iconAnchor = new GPoint(16, 27); victorino.infoWindowAnchor = new GPoint(5, 2); victorino.infoShadowAnchor = new GPoint(14, 25); var patagonia = new GIcon(); patagonia.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/patagoniat_fr.jpg"; patagonia.iconSize = new GSize(33, 27); patagonia.shadowSize = new GSize(36, 34); patagonia.iconAnchor = new GPoint(16, 27); patagonia.infoWindowAnchor = new GPoint(5, 2); patagonia.infoShadowAnchor = new GPoint(14, 25); var mar_azul = new GIcon(); mar_azul.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/mar_azult_fr.jpg"; mar_azul.iconSize = new GSize(33, 27); mar_azul.shadowSize = new GSize(36, 34); mar_azul.iconAnchor = new GPoint(16, 27); mar_azul.infoWindowAnchor = new GPoint(5, 2); mar_azul.infoShadowAnchor = new GPoint(14, 25); var cafe_utopia = new GIcon(); cafe_utopia.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/cafe_utopiat_fr.jpg"; cafe_utopia.iconSize = new GSize(33, 27); cafe_utopia.shadowSize = new GSize(36, 34); cafe_utopia.iconAnchor = new GPoint(16, 27); cafe_utopia.infoWindowAnchor = new GPoint(5, 2); cafe_utopia.infoShadowAnchor = new GPoint(14, 25); var lucia_bistro = new GIcon(); lucia_bistro.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/lucia_bistrot_fr.jpg"; lucia_bistro.iconSize = new GSize(33, 27); lucia_bistro.shadowSize = new GSize(36, 34); lucia_bistro.iconAnchor = new GPoint(5, 15); lucia_bistro.infoWindowAnchor = new GPoint(16, 27); lucia_bistro.infoShadowAnchor = new GPoint(14, 25); var callejon_mesias = new GIcon(); callejon_mesias.image = "http://www.e-gourmets.cl/fotos/thumb_barrio_lastarria/callejon_de_mesiast_fr.jpg"; callejon_mesias.iconSize = new GSize(33, 27); callejon_mesias.shadowSize = new GSize(36, 34); callejon_mesias.iconAnchor = new GPoint(16, 27); callejon_mesias.infoWindowAnchor = new GPoint(5, 2); callejon_mesias.infoShadowAnchor = new GPoint(14, 25); // An array of GIcons, to make the selection easier var icons = []; icons[0] = zabo; icons[1] = victorino; icons[2] = patagonia; icons[3] = cafe_utopia; icons[4] = mar_azul; icons[5] = lucia_bistro; icons[6] = callejon_mesias; // the icon information is passed to this function function createMarker(point,html,icontype) { var marker = new GMarker(point,icons[icontype]); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); // save the info we need to use later for the side_bar gmarkers[i] = marker; htmls[i] = html; // add a line to the side_bar html i++; return marker; } function myclick(i) { gmarkers[i].openInfoWindowHtml(htmls[i]); } var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMenuMapTypeControl(true,false)); map.addMapType(G_SATELLITE_MAP); map.setMapType(G_SATELLITE_MAP); // add the points /* var point = new GLatLng(-33,4372,-70,6411); var marker = createMarker(point,"Some stuff to display in the
First Info Window",0) map.addOverlay(marker); */ var point = new GLatLng(-33.4372,-70.6411); var marker = createMarker(point,"Restaurant Zabo
",0) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4386,-70.6411); var marker = createMarker(point,"Restaurant Victorino
",1) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4393,-70.6412); var marker = createMarker(point,"Restaurant Patagonia
",2) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4393,-70.6411); var marker = createMarker(point,"Restaurant Cafe Utopía
",3) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4395814,-70.6411762); var marker = createMarker(point,"Restaurant Mar Azul
",4) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4393921,-70.6420382); var marker = createMarker(point,"Restaurant Lucia Bistro
",5) map.addOverlay(marker); bounds.extend(point); var point = new GLatLng(-33.4386839,-70.6411175); var marker = createMarker(point,"Restaurant Callejon de Mesias
",6) map.addOverlay(marker); bounds.extend(point); // ===== determine the zoom level from the bounds ===== map.setCenter(bounds.getCenter(), 17); // ===== determine the centre from the bounds ====== } }