function DisplayInfosByPlace(Point,isCenter) { var categorie = getLibelleCateg(Point.Categorie); var divContent=document.createElement("div"); var description= document.createElement("div") addClassOnElement(description,"infowindow"); var pTitle = document.createElement("p"); addClassOnElement(pTitle,'center'); var title = document.createTextNode(categorie); pTitle.appendChild(title); var br1 = document.createElement("br"); var stopName = document.createTextNode(Point.Title); var pName = document.createElement("p"); pName.appendChild(stopName); addClassOnElement(pName,"title"); description.appendChild(pTitle); description.appendChild(br1); description.appendChild(pName); if (MOBILE_MODE == "0") { if (RUB_CODE == RUB_CARTE_INTERACTIVE && !isCenter) { var br2 = document.createElement("br"); description.appendChild(br2); var divLinkCarto = BuildLinkCarto(Point); addClassOnElement(divLinkCarto,"link"); description.appendChild(divLinkCarto); } if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET) { description.appendChild(DisplayLinkStartArrival(Point)); if(Point.ListLines != null && MOBILE_MODE == "0" ) description.appendChild(getLineInfo(Point)); } if (RUB_RI == RUB_CODE) { description.appendChild(DisplayLinkStartArrivalRi(Point)); } if(RUB_CODE == RUB_LIAISON) description.appendChild(getLinkLiaisonDirecte(Point)); if(RUB_CODE == RUB_HORAIRES_SCOLAIRES) description.appendChild(getLinkHorairesScolaires(Point)); } divContent.appendChild(description); return divContent.innerHTML; } function DisplayInfosByStopPoint(Point) { var isMB = "0"; if (document.getElementById("isMB") != null) { isMB = document.getElementById("isMB").value; } var divContent=document.createElement("div"); var description= document.createElement("div") addClassOnElement(description,"infowindow"); var pTitle = document.createElement("p"); addClassOnElement(pTitle,'center'); var title = document.createTextNode("Arrêt"); pTitle.appendChild(title); var stopName = document.createTextNode(Point.Title); var pName = document.createElement("p"); pName.appendChild(stopName); addClassOnElement(pName,"title"); description.appendChild(pTitle); description.appendChild(pName); if (MOBILE_MODE == "0") { if (isMB != "1") { if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET ) { if(Point.ListLines != null) description.appendChild(getLineInfo(Point)); var separator = document.createElement("hr") addClassOnElement(separator,'clear'); description.appendChild(separator); description.appendChild(DisplayLinkStartArrival(Point)); } if ((RUB_CODE== RUB_RI || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET) ) { //var divLinkCarto = BuildLinkCarto(Point); //addClassOnElement(divLinkCarto,"link"); //description.appendChild(divLinkCarto); } if (RUB_RI == RUB_CODE) description.appendChild(DisplayLinkStartArrivalRi(Point)); if(RUB_CODE == RUB_LIAISON) description.appendChild(getLinkLiaisonDirecte(Point)); } if( (RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE== RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || (RUB_CODE == RUB_HORAIRE_ARRET && Point.sens != null))) description.appendChild(BuildHourStopLink(Point)); } if(RUB_CODE != RUB_CARTE_INTERACTIVE) { //description.appendChild(BuildLinkCarto(Point)); } divContent.appendChild(description); return divContent.innerHTML; } function DisplayInfosByAddress(Point) { //Creation du Div qui va contenir les informations dans l'infoWindow var div = document.createElement('DIV'); addClassOnElement(div,"infowindow"); var pTitle = document.createElement("p"); addClassOnElement(pTitle,'center'); var title = document.createTextNode("Adresse"); pTitle.appendChild(title); var stopName = document.createTextNode(Point.Title); var pName = document.createElement("p"); pName.appendChild(stopName); addClassOnElement(pName,"title"); div.appendChild(pTitle); div.appendChild(pName); if (MOBILE_MODE == "0") { if(RUB_CODE == RUB_VELO) div.appendChild(DisplayLinkStartArrivalRi(Point)); if(RUB_CODE == RUB_CARTE_INTERACTIVE) div.appendChild(DisplayLinkStartArrival(Point)); if (RUB_CODE == RUB_RI) div.appendChild(DisplayLinkStartArrivalRi(Point)); } return div; } function DisplayInfosForStart(Point) { var isMB = "0"; if (document.getElementById("isMB") != null) { isMB = document.getElementById("isMB").value; } var description= document.createElement("div") addClassOnElement(description,"infowindow"); var pTitle = document.createElement("p"); addClassOnElement(pTitle,'center'); var title = document.createTextNode("Lieu de départ"); pTitle.appendChild(title); var stopName = document.createTextNode(Point.Title); var pName = document.createElement("p"); pName.appendChild(stopName); addClassOnElement(pName,"title"); description.appendChild(pTitle); description.appendChild(pName); if (MOBILE_MODE == "0" && isMB != "1" && Point.Type == 1) { if( RUB_CODE == RUB_RI && MOBILE_MODE == "0") { var divLinkCarto = BuildLinkCarto(Point); addClassOnElement(divLinkCarto,"link"); description.appendChild(divLinkCarto); } } return description; } function DisplayInfosForArrival(Point) { var isMB = "0"; if (document.getElementById("isMB") != null) { isMB = document.getElementById("isMB").value; } var divContent=document.createElement("div"); var description= document.createElement("div") addClassOnElement(description,"infowindow"); var pTitle = document.createElement("p"); addClassOnElement(pTitle,'center'); var title = document.createTextNode("Lieu d'arrivée"); pTitle.appendChild(title); var stopName = document.createTextNode(Point.Title); var pName = document.createElement("p"); pName.appendChild(stopName); addClassOnElement(pName,"title"); description.appendChild(pTitle); description.appendChild(pName); if( RUB_CODE == RUB_RI && MOBILE_MODE == "0" && isMB != "1" && Point.Type == 1) { var divLinkCarto = BuildLinkCarto(Point); addClassOnElement(divLinkCarto,"link"); description.appendChild(divLinkCarto); } return description; } function DisplayInfosForVia(Point) { var description=""; description="
"+"Etape"+ ":
" + Point.Title+"
"; return description; } function DisplayLinkStartArrivalRi(Point) { //on lui passe l'arret logique if(Point.Type == 2) var Id = Point.LogicalId; else var Id = Point.Id; var SEARCH_ADVANCED = getParamValue("searchAdvanced") //on supprime les ancres sil y en a if (SEARCH_ADVANCED.indexOf("#") != -1) { SEARCH_ADVANCED = SEARCH_ADVANCED.split("#")[0]; } var SEARCH = getParamValue("search") //on supprime les ancres sil y en a if (SEARCH.indexOf("#") != -1) { SEARCH = SEARCH.split("#")[0]; } var mode =""; mode = "ri/"; if(RUB_CODE == RUB_VELO) mode = "ri_velo/"; var link= document.createElement("p"); addClassOnElement(link,"link"); var url = window.location.href; var linkUrl=""; var linkUrlDep=""; var linkUrlArr=""; var linkUrlVia=""; var latDep =""; var latArr = ""; var latVia =""; var lonDep=""; var lonArr=""; var lonVia=""; if( url !='') { url=url.replace("#advancedOptions",""); url=url.replace("#routeForm",""); url=url.replace("#BikeForm",""); url=url.replace("#gmap",""); url=url.replace("#Carto",""); parametersList=url.split('?'); ArrayParams = parametersList[1].split('&'); var sep=""; for (var i=0;i < ArrayParams.length ;i++ ) { var value = ArrayParams[i].split('='); if((value[0]!="") && (value[0]!="laction") && (value[0]!="comDep") && (value[0]!="pointDep") && (value[0]!="comArr") && (value[0]!="pointArr")&& (value[0]!="latDep") && (value[0]!="latArr") && (value[0]!="lonArr") && (value[0]!="lonDep") && (value[0]!="comVia") && (value[0]!="pointVia")) { linkUrl +=sep+ArrayParams[i]; sep='&'; } else { if((value[0]=="comDep" && value[1]!="0") || (value[0]=="pointDep" && value[1]!="")) { linkUrlDep +="&"+ ArrayParams[i] } if((value[0]=="comArr" && value[1]!="0") || (value[0]=="pointArr" && value[1]!="")) { linkUrlArr +="&"+ ArrayParams[i] } if((value[0]=="comVia" && value[1]!="0") || (value[0]=="pointVia" && value[1]!="")) { linkUrlVia +="&"+ ArrayParams[i] } if(value[0]=="latDep") latDep=value[1]; if(value[0]=="latArr") latArr=value[1]; if(value[0]=="lonDep") lonDep=value[1]; if(value[0]=="lonArr") lonArr=value[1]; if(value[0]=="latVia") latVia=value[1]; if(value[0]=="lonVia") lonVia=value[1]; } } } linkUrl=linkUrl.replace("'"," "); //Partie qui permet de garder en memoire les X Y du point cliqué par l'utilisateur et de passer en parametre l'id Geo var linkForAddress=""; var coordDep=""; var coordArr=""; var coordVia=""; if (Point.IdLink !=0) { linkForAddress="$$$"+Point.IdLink; coordDep="&latDep="+Point.Latitude+"&lonDep="+Point.Longitude; coordArr="&latArr="+Point.Latitude+"&lonArr="+Point.Longitude; coordVia="&latVia="+Point.Latitude+"&lonVia="+Point.Longitude; //Permet de garder en memoire les coordonnées if(latArr != "") coordDep+="&latArr="+latArr+"&lonArr="+lonArr; if(latDep != "") coordArr+="&latDep="+latDep+"&lonDep="+lonDep; if(latVia != "") coordVia+="&latVia="+latVia+"&lonVia="+lonVia; } var aDep = document.createElement("a"); var aArr = document.createElement("a"); var textDep= document.createTextNode("Partir de ce lieu"); var textArr= document.createTextNode("Arriver à ce lieu"); aDep.setAttribute("href","/"+mode+"?"+ linkUrl + linkUrlArr + linkUrlVia +"&laction=backForm&comDep="+Point.LocalityCode+"&pointDep="+Id+"$"+encodeTitle(Point.Title)+"$"+Point.Type+"$"+Point.LocalityCode+linkForAddress+"&searchAdvanced=1#gmap"); aArr.setAttribute("href","/"+mode+"?"+ linkUrl+ linkUrlDep + linkUrlVia +"&laction=backForm&comArr="+Point.LocalityCode+"&pointArr="+Id+"$"+encodeTitle(Point.Title)+"$"+Point.Type+"$"+Point.LocalityCode+linkForAddress+"&searchAdvanced=1#gmap"); var textBetween = document.createTextNode(" - "); aDep.appendChild(textDep); aArr.appendChild(textArr); link.appendChild(aDep); link.appendChild(textBetween); link.appendChild(aArr); if (DISPLAY_VIA_RI == "1") { var aVia = document.createElement("a"); var textVia = document.createTextNode("Passer par ce lieu"); aVia.setAttribute("href","/"+mode+"?"+ linkUrl + linkUrlDep + linkUrlArr + "&laction=backForm&comVia="+Point.LocalityCode+"&pointVia="+Id+"$"+encodeTitle(Point.Title)+"$"+Point.Type+"$"+Point.LocalityCode+linkForAddress+"&searchAdvanced=1#gmap"); aVia.appendChild(textVia); var divClear = document.createElement("div") divClear.setAttribute("class","clear"); divClear.setAttribute("className","clear"); link.appendChild(divClear); link.appendChild(aVia); } return link; } function DisplayLinkStartArrivalByLATLON(Point) { var divLink = document.createElement("div"); var aDep=document.createElement("a"); aDep.setAttribute("href","/ri/?rub_code=4&latDep="+Point.Latitude+"&lonDep="+Point.Longitude); var textDep = document.createTextNode("Partir de ce lieu"); aDep.appendChild(textDep); var intertext = document.createTextNode(" - "); var aArr=document.createElement("a"); aArr.setAttribute("href","/ri/?rub_code=4&latArr="+Point.Latitude+"&lonArr="+Point.Longitude); var textArr = document.createTextNode("Arriver à ce lieu"); aArr.appendChild(textArr); divLink.appendChild(aDep); divLink.appendChild(intertext); divLink.appendChild(aArr); return divLink; } function DisplayLinkStartArrival(Point) { if(Point.NumStreet== null ) Point.NumStreet=""; //on lui passe l'arret logique if(Point.Type == 2) var Id = Point.LogicalId; else var Id = Point.Id; //on recupere le contexte var searchAdvanced=getParamValue("searchAdvanced") var divLink = document.createElement("p"); addClassOnElement(divLink,"link"); var aDep=document.createElement("a"); aDep.setAttribute("href","/ri/?rub_code=4&PointDep="+Id +"$"+encodeTitle(Point.Title)+"$"+Point.Type+"$"+Point.LocalityCode+"$"+Point.NumStreet+"$"+Point.IdLink); var textDep = document.createTextNode("Partir de ce lieu"); aDep.appendChild(textDep); var intertext = document.createTextNode(" - "); var aArr=document.createElement("a"); aArr.setAttribute("href","/ri/?rub_code=4&PointArr="+Id +"$"+encodeTitle(Point.Title)+"$"+Point.Type+"$"+Point.LocalityCode+"$"+Point.NumStreet+"$"+Point.IdLink); var textArr = document.createTextNode("Arriver à ce lieu"); aArr.appendChild(textArr); divLink.appendChild(aDep); divLink.appendChild(intertext); divLink.appendChild(aArr); return divLink; } function BuildHourStopLink(Point) { var linkStop=""; var lineId =""; var sens = "" if( typeof(Point.lineId) != "undefined") { lineId = Point.lineId linkStop = "&pa_id="+Point.Id; } else { linkStop = "&pointDep="+Point.LogicalId+"$"+encodeTitle(Point.Title)+ "$2$"+ Point.LocalityCode; } if( typeof(Point.sens) != "undefined") { sens = Point.sens } if (document.getElementById("date") == null) { var dateObj = document.getElementById("laDate"); if (dateObj == null) { var laDate =new Date(); date = laDate.getDate()+"/"+(laDate.getMonth()+1)+"/"+laDate.getFullYear(); } else { date= dateObj.value; } } else { var date =document.getElementById("date").value; } var divLink= document.createElement("div"); addClassOnElement(divLink,"link"); var aLink= document.createElement("a"); aLink.setAttribute("href","../horaires_arret/?rub_code=28&lign_id="+lineId+"&laDate="+date+"&sens="+sens + linkStop); var text = document.createTextNode("Horaires à l'arrêt"); aLink.appendChild(text); divLink.appendChild(aLink); return divLink; } function BuildLinkCarto(Point) { var divMain = document.createElement("div"); addClassOnElement(divMain,"link"); var span = document.createElement("span"); var textSpan = document.createTextNode("Plus de détails : "); span.appendChild(textSpan); divMain.appendChild(span); var aDep=document.createElement("a"); if(Point.Type == 1) aDep.setAttribute("href","/carte_interactive/?rub_code=145&pointDep="+Point.Id+"$"+encodeTitle(Point.Title)+ "$1$"+ Point.LocalityCode); else aDep.setAttribute("href","/carte_interactive/?rub_code=145&latDep="+Point.Latitude+"&lonDep="+Point.Longitude); var textDep = document.createTextNode("Carte interactive"); aDep.appendChild(textDep); divMain.appendChild(aDep); return divMain; } function getLineInfo(obj) { var descriptionLine= document.createElement("div"); var listLines= document.createElement("div"); addClassOnElement(listLines,"listLines"); descriptionLine.appendChild(listLines); if( obj.ListLines.length != 0) { var divClear = document.createElement("div") divClear.setAttribute("class","clear"); divClear.setAttribute("className","clear"); var divLineMess= document.createElement("div"); var label4 = document.createTextNode("Ligne(s) associée(s) à cet arrêt:"); divLineMess.appendChild(label4); var br4 = document.createElement("br"); var br5 = document.createElement("br"); listLines.appendChild(divLineMess); listLines.appendChild(divClear); } else { var divClear = document.createElement("div"); divClear.setAttribute("class","clear"); divClear.setAttribute("className","clear"); var divLineMess= document.createElement("div"); var label5 = document.createTextNode("Pas de ligne pour cet arrêt."); divLineMess.appendChild(label5); listLines.appendChild(divClear); listLines.appendChild(divLineMess); } var tabLines = new Array(); for (var i = 0; i < obj.ListLines.length; ++i) { //On verifie que la ligne n'a pas deja été ajoutée if(!contains(tabLines,obj.ListLines[i].Id)) { tabLines.push(obj.ListLines[i].Id); var divLine = document.createElement("div"); addClassOnElement(divLine,"line"); var span = document.createElement("div"); var labelNumber = document.createTextNode(obj.ListLines[i].Number+" "); span.appendChild(labelNumber); addClassOnElement(span,"pictoLine pictoOp"+obj.IdOperator); divLine.appendChild(span); if (RUB_CODE == "28" || RUB_CODE == "5") { var aLinkHour= document.createElement("a"); aLinkHour.setAttribute("href","/horaires_arret/?rub_code=28&lign_id=" + obj.ListLines[i].Id + "&sens=" + obj.ListLines[i].Direction + "&pa_id=" + obj.Id); aLinkHour.setAttribute("title","Horaires de la ligne " + obj.ListLines[i].Number); var imgLine = document.createElement("img"); imgLine.setAttribute("alt","Horaires de la ligne"); imgLine.setAttribute("src","/cartoV2/img/horlogeMinus.png"); aLinkHour.appendChild(imgLine); var br7 = document.createElement("br"); divLine.appendChild(aLinkHour); } if (parseInt(DISPLAY_LINE_PLAN) == 1) { var aLinkLine= document.createElement("a"); aLinkLine.setAttribute("href","/plan/?rub_code=5&lign_id=" + obj.ListLines[i].Id + "&sens=" + obj.ListLines[i].Direction); aLinkLine.setAttribute("title","Voir le plan de la ligne " + obj.ListLines[i].Number); var imgLine = document.createElement("img"); imgLine.setAttribute("alt","Voir le plan de la ligne"); imgLine.setAttribute("src","/cartoV2/img/gmapIcon.png"); aLinkLine.appendChild(imgLine); var br7 = document.createElement("br"); divLine.appendChild(aLinkLine); } if(obj.ListLines[i].Disrupted == 1) { var aLinkDisrupt= document.createElement("a"); aLinkDisrupt.setAttribute("href","/perturbation/?rub_code=17&lign_id=" + obj.ListLines[i].Id); var imgDisrupt = document.createElement("img"); imgDisrupt.setAttribute("alt","perturbations"); imgDisrupt.setAttribute("src","/cartoV2/img/disrupt.png"); aLinkDisrupt.appendChild(imgDisrupt); var br7 = document.createElement("br"); divLine.appendChild(aLinkDisrupt); } listLines.appendChild(divLine); } } return descriptionLine; } function getLinkLiaisonDirecte(Point) { var divMain = document.createElement("div"); addClassOnElement(divMain,"link"); var aDep=document.createElement("a"); var aArr=document.createElement("a"); var textDep=document.createTextNode(""); if(LACTION == "" ) { aDep.setAttribute("href","/liaisondirecte/?rub_code=22&comDep="+Point.LocalityCode+"$"+encodeTitle(Point.Title)+"$0&laction=arrCity" ); textDep = document.createTextNode("Partir de cette commune"); } else if(LACTION == "arrCity" ) { var comDep=getParamValue("comDep"); aDep.setAttribute("href","/liaisondirecte/?rub_code=22&comDep="+comDep+"&comArr="+Point.LocalityCode+"$"+encodeTitle(Point.Title)+"$0&laction=depStop"); textDep = document.createTextNode("Arriver à cette commune"); } else if(LACTION == "depStop" ) { var comDep=getParamValue("comDep"); var comArr=getParamValue("comArr"); aDep.setAttribute("href","/liaisondirecte/?rub_code=22&comDep="+comDep+"&comArr="+comArr+"&ptaDep="+Point.Id+"$"+encodeTitle(Point.Title)+"$0&laction=arrStop"); textDep = document.createTextNode("Partir de cet arrêt"); } else if(LACTION == "arrStop" ) { var comDep=getParamValue("comDep"); var comArr=getParamValue("comArr"); var ptaDep=getParamValue("ptaDep"); aDep.setAttribute("href","/liaisondirecte/?rub_code=22&comDep="+ comDep + "&comArr=" + comArr + "&ptaDep=" + ptaDep +"&ptaArr="+Point.Id+"$"+encodeTitle(Point.Title)+"$0&laction=result"); textDep = document.createTextNode("Arriver à cet arrêt"); } aDep.appendChild(textDep); divMain.appendChild(aDep); return divMain; } function getLinkHorairesScolaires(Point) { var divMain = document.createElement("div"); addClassOnElement(divMain,"link"); var aDep=document.createElement("a"); var aArr=document.createElement("a"); var textDep=document.createTextNode(""); if(LACTION == "" ) { aDep.setAttribute("href","/horaires_scolaire/?rub_code=147&comPOI="+Point.LocalityCode+"$"+encodeTitle(Point.Title)+"$0&laction=selectPOI" ); textDep = document.createTextNode("Sélectionner cette commune"); } else if(LACTION == "comDep" ) { var comPOI=getParamValue("comPOI"); var point = getParamValue("point"); aDep.setAttribute("href","/horaires_scolaire/?rub_code=147&point="+point +"&comPOI="+comPOI+"&comdep="+Point.Id+"$"+encodeTitle(Point.Title)+"$0&laction=result"); textDep = document.createTextNode("Sélectionner cette commune"); } else if(LACTION == "selectPOI" ) { var comPOI=getParamValue("comPOI"); aDep.setAttribute("href","/horaires_scolaire/?rub_code=147&comPOI="+comPOI+"&point="+Point.Id+"$"+encodeTitle(Point.Title)+"$0&laction=comDep"); textDep = document.createTextNode("Sélectionner cet etablissement"); } else if(LACTION == "arrStop" ) { var comDep=getParamValue("comDep"); var comArr=getParamValue("comArr"); var ptaDep=getParamValue("ptaDep"); aDep.setAttribute("href","/horaires_scolaire/?rub_code=147&comPOI="+ comDep + "&comArr=" + comArr + "&ptaDep=" + ptaDep +"&ptaArr="+Point.Id+"$"+encodeTitle(Point.Title)+"$0"); textDep = document.createTextNode("Arriver à cet arrêt"); } aDep.appendChild(textDep); divMain.appendChild(aDep); return divMain; } function FullScreenControl(map) { var controlDiv = document.createElement('DIV'); // Set CSS styles for the DIV containing the control // Setting padding to 5 px will offset the control // from the edge of the map controlDiv.style.padding = '5px'; // Set CSS for the control border var controlUI = document.createElement('DIV'); controlUI.id = "fullScreenControl"; controlUI.style.backgroundColor = 'white'; controlUI.style.borderStyle = 'solid'; controlUI.style.borderWidth = '1px'; controlUI.style.cursor = 'pointer'; controlUI.style.textAlign = 'center'; controlUI.title = 'Cliquer pour passer en mode plein écran'; controlDiv.appendChild(controlUI); // Set CSS for the control interior var controlText = document.createElement('DIV'); controlText.id = "fullScreenText"; controlText.style.fontFamily = 'Arial,sans-serif'; controlText.style.fontSize = '12px'; controlText.style.paddingTop = '2px'; controlText.style.paddingBottom = '2px'; controlText.style.paddingLeft = '4px'; controlText.style.paddingRight = '4px'; controlText.innerHTML = 'Plein écran'; controlUI.appendChild(controlText); // Setup the click event listener google.maps.event.addDomListener(controlUI, 'click', function () { var div = $("#mapContainer"); if (!div.hasClass("fullscreen")) { controlUI.gMapsParent = div.parent(); $("#fullScreenText").html("Revenir"); div.appendTo('body'); controlUI.title = "Cliquez pour revenir en mode normal "; } else { mapLegend = document.getElementById("mapLegend"); controlUI.title = "Cliquez pour passer en mode plein écran"; $("#fullScreenText").html("Plein écran "); $('#mapLegend').before(div); } $("#global").toggleClass("hidden"); div.toggleClass("fullscreen"); google.maps.event.trigger(map, 'resize'); if (markersArray.length == 0) { var center = new google.maps.LatLng(LAT_CENTER, LON_CENTER); map.setZoom(9); map.setCenter(center); } else { if(RUB_CODE != RUB_CARTE_INTERACTIVE ) SetBounds(markersArray); } if(RUB_CODE == RUB_AGENDA_CARTO){ var center = new google.maps.LatLng(LAT_CENTER, LON_CENTER); map.setZoom(9); map.setCenter(center); } window.location.hash="carto"; }); // touche echap google.maps.event.addDomListener(document, 'keyup', function (e) { var div = $("#mapContainer"); if (div.hasClass("fullscreen") && e.keyCode == 27) { mapLegend = document.getElementById("mapLegend"); controlUI.title = "Cliquez pour passer en mode plein écran"; $("#fullScreenText").html("Plein écran "); $('#mapLegend').before(div); $("#global").toggleClass("hidden"); div.toggleClass("fullscreen"); google.maps.event.trigger(map, 'resize'); } }); controlDiv.index = 1; map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv); execCmd(); } function getLibelleCateg(category) { if (category != null) return ArrayPlacesCateg[category]; return "Lieu"; } function AddPointOnMap(point, DepArr) { tabPoint = point.split('$'); idPoint = tabPoint[0]; typePoint = tabPoint[2]; numPoint = tabPoint[2]; isDep = false; isArr = false; switch(DepArr) { case "Arr" : isArr = true; removePointArr(); if (pointDep == null) HideMarkers(markersArray); break; case "Dep" : isDep = true; removePointDep(); if (pointArr == null) HideMarkers(markersArray); break; } switch(typePoint) { case "1" : AddPlace(UID, idPoint, false, isDep, isArr, false); break; case "2" : AddStopPoint(UID, idPoint, false, isDep, isArr, false); break; case "3" : AddAddressByIdStreetNumStreet(UID, idPoint, numPoint, "", false, isDep, isArr, false); break; } } function getImgByType(Point,isDep,isArr,isCenter,isVia) { var image; //Cas des lieux publics if (Point.Type == 1) { image = imgPlace; if (MOBILE_MODE == "1") { if (Point.Categorie == 2) { image = imgPointVente; } else if (Point.Categorie == 3) { image = imgLocality; } else if (Point.Categorie == 4) { image = imgBikeStation; } } else if (MOBILE_MODE == "0" && Point.Categorie != null) { image = ArrayPlacesImg[Point.Categorie]; } } // Cas des adresses else if (Point.Type == 3) { image = imgPlace; } // Cas des stops else if (Point.Type == 2) { image = imgStop; } if (isCenter == true) { image = imgPointSelected; } if (isDep) { image = imgDepart; } else if (isArr) { image = imgArrivee; } else if (isVia) { image = imgVia; } //alert(MOBILE_MODE); if (MOBILE_MODE == "1" ) { image = image.replace(".png", ".gif"); } return image; } // Ajout point sur KML function AddPointOnKML(lat, long, title, img) { var myLatlng = new google.maps.LatLng(lat, long); var marker = new google.maps.Marker({ position: myLatlng, map: map, optimized: false, title: title, icon: img }); markersArray.push(marker); execCmd(); } // Ajout Event sur KML function addClickEventKML() { google.maps.event.addListener(map, "zoom_changed", function (event) { var zoom = map.getZoom(); if (zoom != ZOOM_LEVEL || startArrivalTab.length != 0) { HideMarkers(markersArray); ShowMarkers(startArrivalTab); } else { ShowMarkers(markersArray); } }); execCmd(); }