var map2; var bounds2; var businesses2; var geocodes2; var cntGeocoded2 = 0; var directionsPanel2; var directions2; var focusedBusiness2; function generateMap2() { if (GBrowserIsCompatible() && document.getElementById("svmap_canvas2") != null) { geocoder2 = new GClientGeocoder(); geocoder2.setCache(null); var mapOptions = { mapTypes:[G_NORMAL_MAP] }; map2 = new GMap2(document.getElementById("svmap_canvas2"), mapOptions); var mapControl = new GMapTypeControl(); map2.addControl(mapControl); map2.addControl(new GLargeMapControl()); map2.disableDoubleClickZoom(); map2.disableScrollWheelZoom(); bounds2 = new GLatLngBounds; map2.setCenter(new GLatLng(43.8522623255626,4.772658348083496), 13); var marker12 = new GIcon(); marker12.image = "http://www.graveson-provence.fr/components/com_svmap/markers/start.png"; marker12.iconSize = new GSize(20,34); marker12.iconAnchor = new GPoint(10,34); marker12.infoWindowAnchor = new GPoint(10,17); businesses2 = [[2,marker12,"Le Cadran Solaire **",43.85080777618674,4.769954681396484,'

Le Cadran Solaire **

5 rue Cabaret Neuf
Graveson
04 90 95 71 79

',"/en/component/svmap/business/le-cadran-solaire-/2.html","France Graveson 13690 5 rue Cabaret Neuf"],[3,marker12,"Le Mas des Amandiers **",43.86494944326349,4.76832389831543,'

Le Mas des Amandiers **

Route d\'avignon
Graveson
04 90 95 81 76

',"/en/component/svmap/business/le-mas-des-amandiers-/3.html","France Graveson 13690 Route d\'avignon "],[4,marker12,"Le Moulin d\'Aure ***",43.846784369748285,4.780340194702148,'

Le Moulin d\'Aure ***

Route de Saint Rémy
Graveson
04 90 95 84 05

',"/en/component/svmap/business/le-moulin-daure-/4.html","France Graveson 13690 Route de Saint Rémy "]]; addBusinesses2(); } } function setBounds2(bounds) { map2.setZoom(map2.getBoundsZoomLevel(bounds)); map2.setCenter(bounds.getCenter()); } function geocodeBusinesses2() { if (cntGeocoded2 < geocodes2.length) { geocoder2.getLocations(geocodes2[cntGeocoded2][7], addressResolved2); } } function addressResolved2(response) { var delay = 0; if (response.Status.code == 620) { delay = 500; } else { if (response.Status.code == 200) { var address = response.Placemark[0]; geocodes2[cntGeocoded2][3] = address.Point.coordinates[1]; geocodes2[cntGeocoded2][4] = address.Point.coordinates[0]; addBusiness(geocodes2[cntGeocoded2]); // Move onto the next address; this skips bad addresses, too. cntGeocoded += 1; } } window.setTimeout(geocodeBusinesses2, delay); } function addBusinesses2() { for (var i=0; i < businesses2.length; i++) { addBusiness2(businesses2[i]); } } function addBusiness2(business) { var point = new GLatLng(business[3], business[4]); var markerOptions = { icon:business[1], draggable: false, "title":business[2] }; var marker = new GMarker(point, markerOptions); var form = '
Trouver un itinéraire : A partir de ce lieu - Vers ce lieu
'; var info = business[5]; info += form; var div = document.createElement("div"); div.style.width = "300px"; div.style.height = "200px"; var pano = new GStreetviewPanorama(div); pano.setLocationAndPOV(point); GEvent.addListener(pano, "error", function() { marker.bindInfoWindowHtml(info); } ); var tabs = [new GInfoWindowTab('Info', info),new GInfoWindowTab('StreetView', div)]; marker.bindInfoWindowTabsHtml(tabs); GEvent.addListener(marker, "infowindowopen", function() { pano.show(); }); GEvent.addListener(marker, "infowindowbeforeclose", function() { pano.hide(); }); map2.addOverlay(marker); bounds2.extend(point); setBounds2(bounds2); } function showFormFrom() { document.getElementById('formFrom').style.display = 'block'; document.getElementById('formTo').style.display = 'none'; return false; } function showFormTo() { document.getElementById('formTo').style.display = 'block'; document.getElementById('formFrom').style.display = 'none'; return false; } function findDirections2(from, to) { if (directions2 == null) { directionsPanel2 = document.getElementById('svmap_directions_panel2'); directions2 = new GDirections(map2, directionsPanel2); GEvent.addListener(directions2, "error", directionsError); } else { directions2.clear(); } directions2.load("from: "+from+" to: "+to); } function directionsError(response) { status = response.getStatus(); switch (status.code) { case 602: message = "No corresponding geographic location could be found for the specified address. This may be due to the fact that the address is relatively new, or it may be incorrect."; break; case 603: message = "The route for the given directions query cannot be returned due to legal or contractual reasons."; break; case 604: message = "The directions between the points mentioned in the query could not be computed. This is usually because there is no route available between the two points, or because there is no data for routing in that region."; break; default: message = "The directions between the points mentioned in the query could not be computed."; break; } alert(message); }