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_HYBRID_MAP] , googleBarOptions : { style : "new", adsOptions: { client: "ca-pub-2835077168755201", channel: "", adsafe: "high", language: "en" } } }; map1 = new GMap2(document.getElementById("svmap_canvas1"), mapOptions); var mapControl = new GMapTypeControl(); map1.addControl(mapControl); map1.addControl(new GLargeMapControl()); map1.enableGoogleBar(); map1.addControl(new GOverviewMapControl()); map1.enableDoubleClickZoom(); map1.enableScrollWheelZoom(); bounds1 = new GLatLngBounds; map1.setCenter(new GLatLng(34.939985151560435,3.31787109375), 5); var marker32 = new GIcon(); marker32.image = "http://www.ana.org.dz/components/com_svmap/markers/letter-s.png"; marker32.iconSize = new GSize(20,34); marker32.iconAnchor = new GPoint(10,34); marker32.infoWindowAnchor = new GPoint(10,17); businesses1 = [[8,marker32,"Station 01",36.13232917178139,6.0040283203125,'

Station 01


Wilaya de Mila

Station service mobile \\\\\\\'NAFTAL\\\\\\\'

Accés : Echangeur Chelghoum Laid / Tadjnanet 

PK : 285+481 

',"/index.php?option=com_svmap&layout=business&business=8&name=station-01","Wilaya de Mila"],[9,marker32,"Station 02",36.178389,1.930987,'

Station 02


Wilaya de Ain Defla

Station service mobile \\\\\\\'NAFTAL\\\\\\\'

Accés : Echangeur Bourached 

PK : 738+726 

',"/index.php?option=com_svmap&layout=business&business=9&name=station-02","Wilaya de Ain Defla"],[10,marker32,"Station 03",36.093499,1.227207,'

Station 03


Wilaya de Chlef

Station service mobile \\\\\\\'NAFTAL\\\\\\\'

Accés : Echangeur Chlef Ouest (Oued Sly) 

PK : 804+494 

',"/index.php?option=com_svmap&layout=business&business=10&name=station-03","Wilaya de Chlef"],[11,marker32,"Station 04",35.712284,0.267062,'

Station 04


Wilaya de Relizane

Station service mobile \\\\\\\'NAFTAL\\\\\\\'

Accés : Echangeur Yellel

PK : 906+559 

',"/index.php?option=com_svmap&layout=business&business=11&name=station-04","Wilaya de Relizane"],[12,marker32,"Station 05",35.107815,-0.81183,'

Station 05


Wilaya de Sidi Bel Abbès

Station service mobile \\\\\\\'NAFTAL\\\\\\\'

Accés : Echangeur Sidi Ali Boussidi

PK : 1043+759 

',"/index.php?option=com_svmap&layout=business&business=12&name=station-05","Wilaya de Sidi Bel Abbès"]]; addBusinesses1(); } } 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]; addBusiness(geocodes1[cntGeocoded1]); } // Move onto the next address; this skips bad addresses, too. cntGeocoded += 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 = '
Get directions : From here - To here
'; var info = business[5]; info += form; var div = document.createElement("div"); div.style.width = "200px"; 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(); }); 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 = "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); }