////////////////////////// // AFFICHAGE INFO BULLE // ////////////////////////// function DisplayInfosRoad(Point, type, context) { // Creation de la DIV qui va contenir les informations dans l'info bulle var div = createElem("div", "", "infowindow", ""); // Ajout du titre var title = "Adresse"; switch (context.toUpperCase()) { case "DEP": title = "Lieu de départ"; break; case "ARR": title = "Lieu d'arrivée"; break; case "VIA": title = "Etape"; break; } div.appendChild(createElem("p", "", "typePt", title)); // Ajout du libelle du point div.appendChild(createElem("p", "", "title", Point.Name + " (" + Point.Locality.Name + ")")); // Ajout des liens if (MOBILE_MODE == "0" && (context == "" || context == "CENTER")) { if (RUB_CODE == RUB_CARTE_INTERACTIVE) div.appendChild(BuildLinkCarto(Point, type)); if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_RI) div.appendChild(BuildLinkRI(Point, type)); } return div; } function DisplayInfosPlace(Point) { var categ = "1"; if (Point.Category != null) categ = Point.Category; else if (Point.CategoryList.length > 0) categ = Point.CategoryList[0].Id; var categorie = ArrayPlacesCateg[categ]; // Creation de la DIV qui va contenir les informations dans l'info bulle var div = createElem("div", "", "infowindow", ""); // Ajout du titre div.appendChild(createElem("p", "", "typePt", categorie)); // Ajout du libelle du point var libelle = Point.Name + " (" + Point.Locality.Name + ")"; if (categ == 3) libelle = Point.Name; div.appendChild(createElem("p", "", "title", libelle)); // Ajout des liens if (MOBILE_MODE == "0") { if (RUB_CODE == RUB_CARTE_INTERACTIVE) div.appendChild(BuildLinkCarto(Point, TYPE_LP)); if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET || RUB_RI == RUB_CODE) div.appendChild(BuildLinkRI(Point, TYPE_LP)); else if(RUB_CODE == RUB_LIAISON) div.appendChild(getLinkLiaisonDirecte(Point)); else if(RUB_CODE == RUB_HORAIRES_SCOLAIRES) div.appendChild(getLinkHorairesScolaires(Point)); } return div; } function DisplayInfosStop(Point) { // Creation de la DIV qui va contenir les informations dans l'info bulle var div = createElem("div", "", "infowindow", ""); // Ajout du titre div.appendChild(createElem("p", "", "typePt", "Arrêt")); // Ajout du libelle du point div.appendChild(createElem("p", "", "title", Point.Name + " (" + Point.Locality.Name + ")")); // Ajout des liens if (MOBILE_MODE == "0") { if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET ) { if(Point.LineList != null) div.appendChild(createLinesList(Point)); div.appendChild(BuildLinkRI(Point, TYPE_PTA)); } if( (RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE== RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || (RUB_CODE == RUB_HORAIRE_ARRET && Point.sens != null))) div.appendChild(BuildHourStopLink(Point)); if ((RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET) ) { var divLinkCarto = BuildLinkCarto(Point, TYPE_PTA); addClassOnElement(divLinkCarto,"linked"); div.appendChild(divLinkCarto); } if (RUB_RI == RUB_CODE) div.appendChild(BuildLinkRI(Point, TYPE_PTA)); if(RUB_CODE == RUB_LIAISON) div.appendChild(getLinkLiaisonDirecte(Point)); } return div; } function DisplayInfosTripPoint(Point, context) { // Creation de la DIV qui va contenir les informations dans l'info bulle var div = createElem("div", "", "infowindow", ""); // Ajout du titre var title = "Arrêt"; switch (context.toUpperCase()) { case "CENTER": if (Point.PointType == TYPE_LP){ title = ArrayPlacesCateg[Point.Category]; } else if (Point.PointType == TYPE_RUE) { title = "Adresse"; } break; case "DEP": title = "Lieu de départ"; break; case "ARR": title = "Lieu d'arrivée"; break; case "VIA": title = "Etape"; break; } div.appendChild(createElem("p", "", "typePt", title)); // Ajout du libelle du point var libelle = Point.Name + " (" + Point.Locality.Name + ")"; if (Point.PointType == TYPE_LP && Point.Category == 3) libelle = Point.Name; div.appendChild(createElem("p", "", "title", libelle)); // Ajout des liens if (MOBILE_MODE == "0" && context == "CENTER") { if(RUB_CODE == RUB_CARTE_INTERACTIVE || RUB_CODE == RUB_PLAN || RUB_CODE == RUB_HORAIRE_LIGNE || RUB_CODE == RUB_HORAIRE_ARRET || RUB_RI == RUB_CODE) div.appendChild(BuildLinkRI(Point, Point.PointType)); else if(RUB_CODE == RUB_LIAISON) div.appendChild(getLinkLiaisonDirecte(Point)); else if(RUB_CODE == RUB_HORAIRES_SCOLAIRES) div.appendChild(getLinkHorairesScolaires(Point)); } return div; } ////////////////////////// // AFFICHAGE RESULT DIV // ////////////////////////// function createPlacesList (obj, centerPoint) { var divListPlaces = createElem("div", "listPlaces", "", ""); // Creation de la DIV qui va contenir les informations var divDescriptionPlace = createElem("div", "descriptionPlace_"+ obj.Id, "descriptionPlace", ""); // Ajout du titre var divTitle = createElem("div", "", "title", ""); var aTitle = createLink("Placetitle_"+obj.Id, "plus left", First2UpperCase(obj.Name), "#gmap", "javascript:ClearWalkTrajects(ArrayWalkTrajects);ZoomOnPoint("+obj.Id +", TYPE_LP);"); divTitle.appendChild(aTitle); var categ = "1"; if (obj.Category != null) categ = obj.Category; else if (obj.CategoryList.length > 0) categ = obj.CategoryList[0].Id; var categorie = ArrayPlacesCateg[categ]; divTitle.appendChild(createElem("span", "", "spanNetwork", categorie)); divTitle.appendChild(createElem("div", "", "clear", "")); divDescriptionPlace.appendChild(divTitle); // Ajout de la description var divTextdescription = createElem("div", "textDescription_"+ obj.Id, "textDescription hideText", ""); var divLinkWalk = createElem("div", "", "linkWalk", ""); var aLinkWalk = createLink("Placetitle_"+obj.Id, "", "Rejoindre à pied", "#gmap", "javascript:ClearWalkTrajects(ArrayWalkTrajects);DisplayWalkItineray("+centerPoint.Latitude+","+centerPoint.Longitude+","+obj.Latitude+","+obj.Longitude+")"); divLinkWalk.appendChild(aLinkWalk); divTextdescription.setAttribute("name","textDescription"); divTextdescription.appendChild(divLinkWalk); divTextdescription.appendChild(createElem("div", "", "clear", "")); divDescriptionPlace.appendChild(divTextdescription); divListPlaces.appendChild(divDescriptionPlace); return divListPlaces.innerHTML; } function createStopsList (obj, centerPoint) { var divListStops = createElem("div", "liststops", "", "") var divDescriptionStop = createElem("div", "descriptionStop_"+ obj.Id, "descriptionStop", "") // titre Arret var divTitle = createElem("div", "", "title", "") divTitle.appendChild(createLink("Stoptitle_"+obj.Id, "plus left", First2UpperCase(obj.Name), "#gmap", "javascript:ClearWalkTrajects(ArrayWalkTrajects);ZoomOnPoint("+obj.Id +","+ TYPE_PTA +");")); divTitle.appendChild(createElem("span", "", "spanNetwork", obj.Operator.Name)); divTitle.appendChild(createElem("div", "", "clear", "")); divDescriptionStop.appendChild(divTitle); var divTextdescription = createElem("div", "textDescription_"+ obj.Id, "hideText", ""); divTextdescription.setAttribute("name","textDescription"); // Lien "rejoindre à pied" var divLinkWalk = createElem("div", "", "linkWalk", "") divLinkWalk.appendChild(createLink("", "", "Rejoindre à pied", "#gmap", "javascript:ClearWalkTrajects(ArrayWalkTrajects);DisplayWalkItineray("+centerPoint.Latitude+","+centerPoint.Longitude+","+obj.Latitude+","+obj.Longitude+",'#0048ff'"+")")); divTextdescription.appendChild(divLinkWalk); divTextdescription.appendChild(createElem("div", "", "clear", "")); if(obj.LineList.length != 0) { divTextdescription.appendChild(createElem("div", "", "title", "Horaires de(s) ligne(s) passant à cet arrêt:")); } else { divTextdescription.appendChild(createElem("div", "", "", "CARTO/NO_LINE indéfini")); } // Liste des lignes for (var i = 0; i < obj.LineList.length; ++i) { for (var j = 0; j < obj.LineList[i].DirectionList.length; ++j) { var divLine = createElem("div", "", "line", ""); divLine.appendChild(createElem("div", "", "pictoLine pictoOp"+obj.OperatorId, obj.LineList[i].Number)); divLine.appendChild(createLink("", "", " vers " + obj.LineList[i].DirectionList[j].Name.toLowerCase(), "/horaires_arret/?rub_code=28&lign_id="+ obj.LineList[i].Id+"&sens="+obj.LineList[i].DirectionList[j].Direction+"&pa_id="+ obj.Id)) divLine.appendChild(createElem("div", "", "clear", "")); divTextdescription.appendChild(divLine); } } divTextdescription.appendChild(createElem("div", "", "clear", "")); divDescriptionStop.appendChild(divTextdescription); divListStops.appendChild(divDescriptionStop); return divListStops.innerHTML; } function createLinesList(data) { var descriptionLine= createElem("div", "", "", ""); var listLines= createElem("div", "", "listLines", ""); if(data.LineList.length != 0) { listLines.appendChild(createElem("div", "", "", "Ligne(s) associée(s)")); listLines.appendChild(createElem("div", "", "clear", "")); } else { listLines.appendChild(createElem("div", "", "", "CARTO/NO_LINE indéfini")); listLines.appendChild(createElem("div", "", "clear", "")); } var tabLines = new Array(); for (var i = 0; i < data.LineList.length; ++i) { //On verifie que la ligne n'a pas deja été ajoutée if(!contains(tabLines,data.LineList[i].Id)) { tabLines.push(data.LineList[i].Id); var divLine = createElem("div", "", "line", ""); divLine.appendChild(createElem("div", "", "pictoLine pictoOp"+data.LineList[i].OperatorId, data.LineList[i].Number+" ")); if (data.LineList[i].DirectionList[0].Disrupted) { divLine.appendChild(createImgLink("", "", "Voir les perturbation(s) sur la ligne", imgDisrupt, "/perturbation/?rub_code=17&lign_id=" + data.LineList[i].Id)); } if (RUB_CODE == "28") { divLine.appendChild(createImgLink("", "", "Horaires de la ligne", imgHour, "/horaires_arret/?rub_code=28&lign_id=" + data.LineList[i].Id + "&sens=" + data.LineList[i].DirectionList[0].Direction + "&pa_id=" + data.Id)); } if (parseInt(DISPLAY_LINE_PLAN) == 1){ divLine.appendChild(createImgLink("", "", "Voir le plan de la ligne", imgLine, "/plan/?rub_code=5&lign_id=" + data.LineList[i].Id + "&sens=" + data.LineList[i].Direction)); } /* if(data.LineList[i].Disrupted == 1) { var aLinkDisrupt= document.createElement("a"); aLinkDisrupt.setAttribute("href","/perturbation/?rub_code=17&lign_id=" + data.LineList[i].Id); var imgDisrupt = document.createElement("img"); imgDisrupt.setAttribute("alt","perturbations"); imgDisrupt.setAttribute("src", imgDisrupt); aLinkDisrupt.appendChild(imgDisrupt); divLine.appendChild(aLinkDisrupt); }*/ listLines.appendChild(divLine); } } descriptionLine.appendChild(listLines); return descriptionLine; } ///////////////////// // BUILD LINK // ///////////////////// function BuildLinkCarto(Point, type) { var divMain = document.createElement("div"); addClassOnElement(divMain,"link"); var span = document.createElement("span"); var textSpan = document.createTextNode("Plus d'information : "); span.appendChild(textSpan); divMain.appendChild(span); var aDep=document.createElement("a"); if(type == TYPE_PTA) aDep.setAttribute("href","/carte_interactive/?rub_code=145&latDep="+Point.Latitude+"&lonDep="+Point.Longitude); else aDep.setAttribute("href","/carte_interactive/?rub_code=145&pointDep=" + setTripPointKey(Point, type)); var textDep = document.createTextNode("Choisir ce lieu"); aDep.appendChild(textDep); divMain.appendChild(aDep); return divMain; } // Création du lien "horaires à l'arrêt" function BuildHourStopLink(Point) { var date; 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 { date = document.getElementById("date").value; } var lineId = Point.LineList[0].Id; var sens = Point.LineList[0].DirectionList[0].Direction; 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 + "&pa_id=" + Point.Id); var text = document.createTextNode("Horaires à l'arrêt"); aLink.appendChild(text); divLink.appendChild(aLink); return divLink; } // Création du lien départ, arrivée et via function BuildLinkRI(Point, type) { var linkUrl=""; var linkUrlDep=""; var linkUrlArr=""; var linkUrlVia=""; if (RUB_CODE == RUB_RI) { var url = window.location.href; if( url !='') { url=url.replace("#routeForm",""); 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]!="rub_code") && (value[0]!="laction") && (value[0]!="comDep") && (value[0]!="pointDep") && (value[0]!="pointPrefDep") && (value[0]!="comArr") && (value[0]!="pointArr") && (value[0]!="pointPrefArr") && (value[0]!="comVia") && (value[0]!="pointVia") && (value[0]!="pointPrefVia")) { linkUrl +=sep+ArrayParams[i]; } else { if((value[0]=="comDep" && value[1]!="0") || (value[0]=="pointDep" && value[1]!="") || (value[0]=="numDep" && value[1]!="") || (value[0]=="pointPrefDep" && value[1]!="")) { linkUrlDep += sep + ArrayParams[i] } if((value[0]=="comArr" && value[1]!="0") || (value[0]=="pointArr" && value[1]!="") || (value[0]=="numArr" && value[1]!="") || (value[0]=="pointPrefArr" && value[1]!="")) { linkUrlArr += sep + ArrayParams[i] } if((value[0]=="comVia" && value[1]!="0") || (value[0]=="pointVia" && value[1]!="") || (value[0]=="numVia" && value[1]!="") || (value[0]=="pointPrefVia" && value[1]!="")) { linkUrlVia += sep + ArrayParams[i] } } } } linkUrl=linkUrl.replace("'"," "); } var divLink = document.createElement("div"); addClassOnElement(divLink,"link"); var aDep=document.createElement("a"); aDep.setAttribute("href","/ri/?rub_code=4"+ linkUrl + linkUrlArr + linkUrlVia +"&pointDep="+ setTripPointKey(Point, type)); 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"+ linkUrl + linkUrlDep + linkUrlVia +"&pointArr=" + setTripPointKey(Point, type)); var textArr = document.createTextNode("Arriver à ce lieu"); aArr.appendChild(textArr); divLink.appendChild(aDep); divLink.appendChild(intertext); divLink.appendChild(aArr); if (DISPLAY_VIA_RI == "1") { var divLink2 = document.createElement("div"); addClassOnElement(divLink2,"link"); var aVia = document.createElement("a"); aVia.setAttribute("href","/ri/?rub_code=4"+ linkUrl + linkUrlArr + linkUrlDep +"&pointVia=" + setTripPointKey(Point, type)); var textVia = document.createTextNode("Passer par ce lieu"); aVia.appendChild(textVia); divLink2.appendChild(aVia); divLink.appendChild(divLink2); } return divLink; } //permet d'initialiser les evenements sur les checkBox qui representent les types de poi function InitPOI() { initPOI = true; ArrayPlacesCateg[1] = "Lieu public"; ArrayPlacesImg[1] = CARTO_IMG + "/place_1.png"; ArrayPlaces[1] = new Array(); $('#s1_1').bind("click", {}, function () { if ($('#s1_1').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 1); } else { HideMarkers(ArrayPlaces[1] )} }); ArrayPlacesCateg[2] = "Point de vente"; ArrayPlacesImg[2] = CARTO_IMG + "/place_2.png"; ArrayPlaces[2] = new Array(); $('#s1_2').bind("click", {}, function () { if ($('#s1_2').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 2); } else { HideMarkers(ArrayPlaces[2] )} }); ArrayPlacesCateg[3] = "Commune"; ArrayPlacesImg[3] = CARTO_IMG + "/place_3.png"; $('#s1_3').bind("click", {}, function () { if ($('#s1_3').is(':checked') && map.getZoom() >= ZOOM_SHOW_LOCALITY) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), "3"); } else { HideMarkers(ArrayCities); } }); ArrayPlacesCateg[4] = "Station vélo libre-service"; ArrayPlacesImg[4] = CARTO_IMG + "/place_4.png"; ArrayPlaces[4] = new Array(); $('#s1_4').bind("click", {}, function () { if ($('#s1_4').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 4); } else { HideMarkers(ArrayPlaces[4] )} }); ArrayPlacesCateg[5] = "Parc à vélo"; ArrayPlacesImg[5] = CARTO_IMG + "/place_5.png"; ArrayPlaces[5] = new Array(); $('#s1_5').bind("click", {}, function () { if ($('#s1_5').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 5); } else { HideMarkers(ArrayPlaces[5] )} }); ArrayPlacesCateg[6] = "Parc relais"; ArrayPlacesImg[6] = CARTO_IMG + "/place_6.png"; ArrayPlaces[6] = new Array(); $('#s1_6').bind("click", {}, function () { if ($('#s1_6').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 6); } else { HideMarkers(ArrayPlaces[6] )} }); ArrayPlacesCateg[7] = "Pôle d'échanges"; ArrayPlacesImg[7] = CARTO_IMG + "/place_7.png"; ArrayPlaces[7] = new Array(); $('#s1_7').bind("click", {}, function () { if ($('#s1_7').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 7); } else { HideMarkers(ArrayPlaces[7] )} }); ArrayPlacesCateg[8] = "Quartier"; ArrayPlacesImg[8] = CARTO_IMG + "/place_8.png"; ArrayPlaces[8] = new Array(); $('#s1_8').bind("click", {}, function () { if ($('#s1_8').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 8); } else { HideMarkers(ArrayPlaces[8] )} }); ArrayPlacesCateg[9] = "Zone"; ArrayPlacesImg[9] = CARTO_IMG + "/place_9.png"; ArrayPlaces[9] = new Array(); $('#s1_9').bind("click", {}, function () { if ($('#s1_9').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 9); } else { HideMarkers(ArrayPlaces[9] )} }); ArrayPlacesCateg[10] = "Service"; ArrayPlacesImg[10] = CARTO_IMG + "/place_10.png"; ArrayPlaces[10] = new Array(); $('#s1_10').bind("click", {}, function () { if ($('#s1_10').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 10); } else { HideMarkers(ArrayPlaces[10] )} }); ArrayPlacesCateg[11] = "Place de parking"; ArrayPlacesImg[11] = CARTO_IMG + "/place_11.png"; ArrayPlaces[11] = new Array(); $('#s1_11').bind("click", {}, function () { if ($('#s1_11').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 11); } else { HideMarkers(ArrayPlaces[11] )} }); ArrayPlacesCateg[200] = "Administration"; ArrayPlacesImg[200] = CARTO_IMG + "/place_200.png"; ArrayPlaces[200] = new Array(); $('#s1_200').bind("click", {}, function () { if ($('#s1_200').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 200); } else { HideMarkers(ArrayPlaces[200] )} }); ArrayPlacesCateg[201] = "Aéroport"; ArrayPlacesImg[201] = CARTO_IMG + "/place_201.png"; ArrayPlaces[201] = new Array(); $('#s1_201').bind("click", {}, function () { if ($('#s1_201').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 201); } else { HideMarkers(ArrayPlaces[201] )} }); ArrayPlacesCateg[202] = "Autre équipement"; ArrayPlacesImg[202] = CARTO_IMG + "/place_202.png"; ArrayPlaces[202] = new Array(); $('#s1_202').bind("click", {}, function () { if ($('#s1_202').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 202); } else { HideMarkers(ArrayPlaces[202] )} }); ArrayPlacesCateg[203] = "Centre commercial"; ArrayPlacesImg[203] = CARTO_IMG + "/place_203.png"; ArrayPlaces[203] = new Array(); $('#s1_203').bind("click", {}, function () { if ($('#s1_203').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 203); } else { HideMarkers(ArrayPlaces[203] )} }); ArrayPlacesCateg[204] = "Centre de soins"; ArrayPlacesImg[204] = CARTO_IMG + "/place_204.png"; ArrayPlaces[204] = new Array(); $('#s1_204').bind("click", {}, function () { if ($('#s1_204').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 204); } else { HideMarkers(ArrayPlaces[204] )} }); ArrayPlacesCateg[205] = "Cimetière"; ArrayPlacesImg[205] = CARTO_IMG + "/place_205.png"; ArrayPlaces[205] = new Array(); $('#s1_205').bind("click", {}, function () { if ($('#s1_205').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 205); } else { HideMarkers(ArrayPlaces[205] )} }); ArrayPlacesCateg[206] = "Enseignement"; ArrayPlacesImg[206] = CARTO_IMG + "/place_206.png"; ArrayPlaces[206] = new Array(); $('#s1_206').bind("click", {}, function () { if ($('#s1_206').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 206); } else { HideMarkers(ArrayPlaces[206] )} }); ArrayPlacesCateg[207] = "FAC/Université"; ArrayPlacesImg[207] = CARTO_IMG + "/place_207.png"; ArrayPlaces[207] = new Array(); $('#s1_207').bind("click", {}, function () { if ($('#s1_207').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 207); } else { HideMarkers(ArrayPlaces[207] )} }); ArrayPlacesCateg[208] = "Formation professionnelle"; ArrayPlacesImg[208] = CARTO_IMG + "/place_208.png"; ArrayPlaces[208] = new Array(); $('#s1_208').bind("click", {}, function () { if ($('#s1_208').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 208); } else { HideMarkers(ArrayPlaces[208] )} }); ArrayPlacesCateg[209] = "Gare"; ArrayPlacesImg[209] = CARTO_IMG + "/place_209.png"; ArrayPlaces[209] = new Array(); $('#s1_209').bind("click", {}, function () { if ($('#s1_209').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 209); } else { HideMarkers(ArrayPlaces[209] )} }); ArrayPlacesCateg[210] = "Lieux de culte"; ArrayPlacesImg[210] = CARTO_IMG + "/place_210.png"; ArrayPlaces[210] = new Array(); $('#s1_210').bind("click", {}, function () { if ($('#s1_210').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 210); } else { HideMarkers(ArrayPlaces[210] )} }); ArrayPlacesCateg[211] = "Mairie"; ArrayPlacesImg[211] = CARTO_IMG + "/place_211.png"; ArrayPlaces[211] = new Array(); $('#s1_211').bind("click", {}, function () { if ($('#s1_211').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 211); } else { HideMarkers(ArrayPlaces[211] )} }); ArrayPlacesCateg[212] = "Piscine"; ArrayPlacesImg[212] = CARTO_IMG + "/place_212.png"; ArrayPlaces[212] = new Array(); $('#s1_212').bind("click", {}, function () { if ($('#s1_212').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 212); } else { HideMarkers(ArrayPlaces[212] )} }); ArrayPlacesCateg[213] = "Site culturel"; ArrayPlacesImg[213] = CARTO_IMG + "/place_213.png"; ArrayPlaces[213] = new Array(); $('#s1_213').bind("click", {}, function () { if ($('#s1_213').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 213); } else { HideMarkers(ArrayPlaces[213] )} }); ArrayPlacesCateg[214] = "Stade"; ArrayPlacesImg[214] = CARTO_IMG + "/place_214.png"; ArrayPlaces[214] = new Array(); $('#s1_214').bind("click", {}, function () { if ($('#s1_214').is(':checked') && map.getZoom() >= ZOOM_SHOW_POI) { AddPlacesByBoundingBox(map.getBounds().getSouthWest().lat(), map.getBounds().getSouthWest().lng(), map.getBounds().getNorthEast().lat(), map.getBounds().getNorthEast().lng(), 214); } else { HideMarkers(ArrayPlaces[214] )} }); } function FullScreenControl(map) { var controlDiv = document.createElement('DIV'); // Set CSS for the control border var controlUI = document.createElement('DIV'); controlUI.id = "fullScreenControl"; controlUI.title = "Cliquez pour passer en mode plein écran"; controlDiv.appendChild(controlUI); // Set CSS for the control interior var controlText = document.createElement('DIV'); controlText.id = "fullScreenText"; 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("Mode normal"); div.appendTo('body'); controlUI.title = "Cliquez pour revenir en mode normal "; controlText.innerHTML = "Mode normal"; } else { mapLegend = document.getElementById("mapLegend"); controlUI.title = "Cliquez pour passer en mode plein écran"; $("fullScreenText").html("Plein écran"); $('#mapLegend').before(div); controlText.innerHTML = "Plein écran"; } $("#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.setCenter(center); map.setZoom(ZOOM_LEVEL); } else { if(RUB_CODE != RUB_CARTE_INTERACTIVE ) SetBounds(markersArray); } window.location.hash="Carto"; }); // touche echap google.maps.event.addDomListener(document, 'keyup', function (e) { var div = $("#mapContainer"); if (div.hasClass("fullscreen") && e.keyCode == 27) { controlUI.title = "Cliquez pour passer en mode plein écran"; controlUI.gMapsParent.prepend(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(); } //Retourne le libellé function getLib(lib) { var libelle = ""; switch(lib) { case "NO_STOP" : libelle = "Pas d'arrêt à proximité"; case "NO_PLACE" : libelle = "Pas de lieu à proximité"; break; default : libelle = ""; break; } return libelle; } function getColorByMode(Mode) { var color = "#000000"; switch(Mode) { case "MARCHE", "FOOT" : color = "#0048ff"; break; case "WALK" : color = "#0048ff"; break; case "ROUTE", "PRIVATE_VEHICLE" : color = "#ABABAB"; break; case "CAR_POOL" : color = "#ABABAB"; break; case "TAD", "TOD" : color = "#E23EF5"; break; case "BIKE", "BICYCLE" : color = "#e400ff"; break; case "BIKEWAY": color="#0000FF"; break; case "BOAT" : color="#FF8040"; break; } return color; } function getImageMarker(image) { var imageMarker = { url: image, size: new google.maps.Size(23, 23), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(10, 10), scaledSize: new google.maps.Size(23, 23) }; if (image == imgPointSelected || image == imgDepart || image == imgArrivee || image == imgVia) { var imageMarker = { url: image, size: new google.maps.Size(34, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(0, 30), scaledSize: new google.maps.Size(34, 30) }; } return imageMarker; }