var map1; var bounds1; var businesses1; var geocodes1; var cntGeocoded1 = 0; var directionsPanel1; var directions1; var focusedBusiness1; function generateMap1() { if (GBrowserIsCompatible() && document.getElementById("svmap_canvas1") != null) { geocoder1 = new GClientGeocoder(); geocoder1.setCache(null); var mapOptions = { mapTypes:[G_NORMAL_MAP] }; map1 = new GMap2(document.getElementById("svmap_canvas1"), mapOptions); var mapControl = new GMapTypeControl(); map1.addControl(mapControl); map1.addControl(new GSmallMapControl()); map1.addControl(new GOverviewMapControl()); map1.disableDoubleClickZoom(); map1.disableScrollWheelZoom(); bounds1 = new GLatLngBounds; map1.setCenter(new GLatLng(43.80508,4.657817), 10); var marker2 = new GIcon(); marker2.image = "http://www.topogis.com/components/com_svmap/markers/black.png"; marker2.iconSize = new GSize(12,20); marker2.iconAnchor = new GPoint(6,20); marker2.infoWindowAnchor = new GPoint(6,10); var marker3 = new GIcon(); marker3.image = "http://www.topogis.com/components/com_svmap/markers/blue.png"; marker3.iconSize = new GSize(12,20); marker3.iconAnchor = new GPoint(6,20); marker3.infoWindowAnchor = new GPoint(6,10); var marker6 = new GIcon(); marker6.image = "http://www.topogis.com/components/com_svmap/markers/green.png"; marker6.iconSize = new GSize(12,20); marker6.iconAnchor = new GPoint(6,20); marker6.infoWindowAnchor = new GPoint(6,10); var marker8 = new GIcon(); marker8.image = "http://www.topogis.com/components/com_svmap/markers/purple.png"; marker8.iconSize = new GSize(12,20); marker8.iconAnchor = new GPoint(6,20); marker8.infoWindowAnchor = new GPoint(6,10); var marker9 = new GIcon(); marker9.image = "http://www.topogis.com/components/com_svmap/markers/red.png"; marker9.iconSize = new GSize(12,20); marker9.iconAnchor = new GPoint(6,20); marker9.infoWindowAnchor = new GPoint(6,10); businesses1 = [[2,marker9,"TOPOGIS - Agence Lorraine Champagne Ardennes",48.718185,6.637035,'

TOPOGIS - Agence Lorraine
Champagne Ardennes

11 Rue Principale
57810 MONCOURT
+33 (0)3 87 86 70 70


',"/component/svmap/business/topogis-agence-LORCA/2","Moncourt 57810 11 Rue Principale"],[3,marker9,"TOPOGIS - Agence Alsace Franche-Comté",48.720779,7.765747,'

TOPOGIS - Agence
Alsace Franche-Comté

28 Rue des Primevères
67170 GEUDERTHEIM
+33 (0)3 88 68 03 33


',"/component/svmap/business/topogis-AFC/3","Geudertheim 67170 28 Rue des Primevères"]]; addBusinesses1(); geocodes1 = [[10,marker3,"TOPOGIS",,,'

TOPOGIS

11 Rue Principale
57810 MONCOURT
+33 (0)3 87 86 70 70

 

',"/component/svmap/business/topogis/10","MONCOURT 57810 11 Rue Principale"]]; geocodeBusinesses1(); } } function setBounds1(bounds) { map1.setZoom(map1.getBoundsZoomLevel(bounds)); map1.setCenter(bounds.getCenter()); } function geocodeBusinesses1() { if (cntGeocoded1 < geocodes1.length) { geocoder1.getLocations(geocodes1[cntGeocoded1][7], addressResolved1); } } function addressResolved1(response) { var delay = 0; if (response.Status.code == 620) { delay = 500; } else { if (response.Status.code == 200) { var address = response.Placemark[0]; geocodes1[cntGeocoded1][3] = address.Point.coordinates[1]; geocodes1[cntGeocoded1][4] = address.Point.coordinates[0]; addBusiness1(geocodes1[cntGeocoded1]); } // Move onto the next address; this skips bad addresses, too. cntGeocoded1 += 1; } window.setTimeout(geocodeBusinesses1, delay); } function addBusinesses1() { for (var i=0; i < businesses1.length; i++) { addBusiness1(businesses1[i]); } } function addBusiness1(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; info = '
'+info+'
'; marker.bindInfoWindowHtml(info); map1.addOverlay(marker); bounds1.extend(point); setBounds1(bounds1); } 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 findDirections1(from, to) { if (directions1 == null) { directionsPanel1 = document.getElementById('svmap_directions_panel1'); directions1 = new GDirections(map1, directionsPanel1); GEvent.addListener(directions1, "error", directionsError); } else { directions1.clear(); } directions1.load("from: "+from+" to: "+to); } function directionsError(response) { status = response.getStatus(); switch (status.code) { case 602: message = "Aucune localisation géographic n‘a pu être trouvé pour cette adresse. Cela peut venir du fait que l‘adresse est trop récente, ou incorrecte."; break; case 603: message = "L‘itinéraire demandé ne peut être communiqué pour des raisons légales ou contractuelles."; break; case 604: message = "L‘itinéraire demandé n‘a pas pu être trouvé. Cela peut venir du fait qu‘aucun itinéraire n‘existe entre ces deux points, ou parcequ‘il n‘y a pas d‘informations de localisation dans cette région."; break; default: message = "L‘itinéraire demandé n‘a pas pu être trouvé."; break; } alert(message); }