//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; } // Permet de retourner la liste complète des arrets pour la partie description de la carte A proximité function createListeStops (obj,UID,centerPoint) { obj.Title=obj.Title.replace("'"," ").toLowerCase(); var textToDisplay; var br1 = document.createElement("br"); var divListStops = document.createElement("div"); divListStops.setAttribute("id","liststops"); var divDescriptionStop = document.createElement("div"); divDescriptionStop.setAttribute("id","descriptionStop_"+ obj.Id); addClassOnElement(divDescriptionStop, "descriptionStop"); var divTitle = document.createElement("div"); divTitle.setAttribute("class","title"); var aTitle = document.createElement("a"); addClassOnElement(aTitle, "plus"); addClassOnElement(aTitle, "left"); aTitle.setAttribute("id","Stoptitle_"+obj.Id); aTitle.setAttribute("href","#gmap"); aTitle.setAttribute("onclick","javascript:ClearWalkTrajects(ArrayWalkTrajects);ZoomByPoint("+obj.Id +",'"+ obj.Title +"',"+obj.Type +","+obj.Latitude +","+obj.Longitude+");"); var label1 = document.createTextNode(First2UpperCase(obj.Title) ); aTitle.appendChild(label1); var spanNetwork = document.createElement("span"); var labelNetWork = document.createTextNode(obj.OperatorName); spanNetwork.appendChild(labelNetWork); addClassOnElement(spanNetwork,"spanNetwork"); divTitle.appendChild(aTitle); divTitle.appendChild(spanNetwork); var divClear = document.createElement("div"); addClassOnElement(divClear,"clear"); divTitle.appendChild(divClear); divDescriptionStop.appendChild(divTitle); var divTextdescription =document.createElement("div"); divTextdescription.setAttribute("id","textDescription_"+ obj.Id); divTextdescription.setAttribute("name","textDescription"); addClassOnElement(divTextdescription, "hideText"); var divLinkWalk = document.createElement("div"); var marche = document.createElement("img"); marche.setAttribute("src", "../img/default/Picto/marche.png"); marche.setAttribute("alt", "picto marcheur"); divLinkWalk.appendChild(marche); var aLinkWalk= document.createElement("a"); aLinkWalk.setAttribute("href","#gmap"); aLinkWalk.setAttribute("onclick","javascript:ClearWalkTrajects(ArrayWalkTrajects);DisplayItinerayByWalk("+centerPoint.Latitude+","+centerPoint.Longitude+","+obj.Latitude+","+obj.Longitude+",'#00FF00'"+")") var label4 = document.createTextNode("Rejoindre à pied "); aLinkWalk.appendChild(label4); divLinkWalk.appendChild(aLinkWalk); divTextdescription.appendChild(divLinkWalk); addClassOnElement(divLinkWalk, "linkWalk"); var divClear1 = document.createElement("div"); addClassOnElement(divClear1, "clear"); divTextdescription.appendChild(divClear1); if(obj.ListLines.length != 0) { var divClear = document.createElement("div") divClear.setAttribute("class","clear"); divClear.setAttribute("className","clear"); var divLineMess= document.createElement("div"); addClassOnElement(divLineMess,"title"); var label4 = document.createTextNode("Horaires de(s) ligne(s) passant à cet arrêt:"); divLineMess.appendChild(label4); var br4 = document.createElement("br"); divTextdescription.appendChild(br4); divTextdescription.appendChild(divClear); divTextdescription.appendChild(divLineMess); } 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); var br5 = document.createElement("br"); var br6 = document.createElement("br"); divTextdescription.appendChild(br5); divTextdescription.appendChild(br6); divTextdescription.appendChild(divClear); divTextdescription.appendChild(divLineMess); } for (var i = 0; i < obj.ListLines.length; ++i) { var divLine = document.createElement("div"); var labelNumber = document.createTextNode(obj.ListLines[i].Number); var spanPicto= document.createElement("div"); spanPicto.appendChild(labelNumber); addClassOnElement(spanPicto, "pictoLine pictoOp"+obj.IdOperator); // divTextdescription.appendChild(spanPicto); var aLinkLine= document.createElement("a"); aLinkLine.setAttribute("href","/horaires_arret/?rub_code=28&lign_id="+ obj.ListLines[i].Id+"&sens="+obj.ListLines[i].Direction+"&pa_id="+ obj.Id); var label6 = document.createTextNode(" vers "+obj.ListLines[i].DirectionName.toLowerCase()); aLinkLine.appendChild(label6); var br7 = document.createElement("br"); divLine.appendChild(spanPicto); divLine.appendChild(aLinkLine) divTextdescription.appendChild(divLine); divTextdescription.appendChild(br7); } divDescriptionStop.appendChild(divTextdescription); divListStops.appendChild(divDescriptionStop); return divListStops.innerHTML; } //Permet d'ouvrir le volet contenant les informations sur l'arrêt a proximité selectionné function showText(type, id) { if(document.getElementById(type + "title_" + id) !=null) { // Affichage du div contenant le menu ouvert var classe = document.getElementById(type + "title_" + id).getAttribute("class"); if(classe == "minus") { closeTexts(); document.getElementById(type + "title_" + id).setAttribute("class","plus"); document.getElementById("textDescription_" + id).setAttribute("class","hideText"); document.getElementById(type + "title_" + id).setAttribute("className","plus"); document.getElementById("textDescription_" + id).setAttribute("className","hideText"); } else { closeTexts(); document.getElementById(type + "title_" + id).setAttribute("class","minus"); document.getElementById("textDescription_" + id).setAttribute("class","showText"); document.getElementById(type + "title_" + id).setAttribute("className","minus"); document.getElementById("textDescription_" + id).setAttribute("className","showText"); addClassOnElement(document.getElementById("description" + type + "_" + id),"border"); } } } // Permet de retourner la liste complète des POI pour la partie description de la carte A proximité function createListePlaces (obj,UID,centerPoint) { obj.Title=obj.Title.replace("'"," ").toLowerCase(); var textToDisplay; var br1 = document.createElement("br"); var divListPlaces = document.createElement("div"); divListPlaces.setAttribute("id","listPlaces"); var divDescriptionPlace = document.createElement("div"); divDescriptionPlace.setAttribute("id","descriptionPlace_"+ obj.Id); addClassOnElement(divDescriptionPlace, "descriptionPlace"); var divTitle = document.createElement("div"); divTitle.setAttribute("class","title"); var aTitle = document.createElement("a"); addClassOnElement(aTitle, "plus"); addClassOnElement(aTitle, "left"); aTitle.setAttribute("id","Placetitle_"+obj.Id); aTitle.setAttribute("href","#gmap"); aTitle.setAttribute("onclick","javascript:ClearWalkTrajects(ArrayWalkTrajects);ZoomByPoint("+obj.Id +",'"+ obj.Title +"',"+obj.Type +","+obj.Latitude +","+obj.Longitude+");"); var label1 = document.createTextNode(First2UpperCase(obj.Title) ); aTitle.appendChild(label1); var spanNetwork = document.createElement("span"); var labelNetWork = document.createTextNode(getLibelleCateg(obj.Categorie)); spanNetwork.appendChild(labelNetWork); addClassOnElement(spanNetwork,"spanNetwork"); divTitle.appendChild(aTitle); divTitle.appendChild(spanNetwork); var divClear = document.createElement("div"); addClassOnElement(divClear,"clear"); divTitle.appendChild(divClear); divDescriptionPlace.appendChild(divTitle); var divTextdescription =document.createElement("div"); divTextdescription.setAttribute("id","textDescription_"+ obj.Id); divTextdescription.setAttribute("name","textDescription"); addClassOnElement(divTextdescription, "hideText"); var divLinkWalk = document.createElement("div"); var aLinkWalk= document.createElement("a"); aLinkWalk.setAttribute("href","#gmap"); aLinkWalk.setAttribute("onclick","javascript:ClearWalkTrajects(ArrayWalkTrajects);DisplayItinerayByWalk("+centerPoint.Latitude+","+centerPoint.Longitude+","+obj.Latitude+","+obj.Longitude+",'#00FF00'"+")") var label4 = document.createTextNode("Rejoindre à pied "); aLinkWalk.appendChild(label4); divLinkWalk.appendChild(aLinkWalk); divTextdescription.appendChild(divLinkWalk); addClassOnElement(divLinkWalk, "linkWalk"); var divClear1 = document.createElement("div"); addClassOnElement(divClear1, "clear"); divTextdescription.appendChild(divClear1); divDescriptionPlace.appendChild(divTextdescription); divListPlaces.appendChild(divDescriptionPlace); return divListPlaces.innerHTML; } //permet d'initialiser les evenements sur les checkBox qui representent les types de poi function InitPOI() { $('#s2_0').bind("click", {}, function () { if ($('#s2_0').is(':checked') && map.getZoom() > 15) { AddProxiStopPointsByLATLON(UID, map.getCenter().lat(), map.getCenter().lng(), DISTANCE_PROXI_POINT); } else { HideMarkers(ArrayStops); } }); ArrayPlacesCateg[3] = "Commune"; ArrayPlacesImg[3] = "/cartoV2/img/place_3.png"; $('#s1_3').bind("click", {}, function () { if ($('#s1_3').is(':checked') && map.getZoom() > 11) { AddProxiPlacesByLATLONCat(UID, map.getCenter().lat(), map.getCenter().lng(), DISTANCE_PROXI_CITY, 3); } else { HideMarkers(ArrayCities); } }); ArrayPlacesCateg[1] = "Lieu"; ArrayPlacesImg[1] = "/cartoV2/img/place_1.png"; ArrayPlaces[1] = new Array(); $('#s1_1').bind("click", {}, function () { if ($('#s1_1').is(':checked') && map.getZoom() >= 15) { AddProxiPlacesByLATLONCat(UID, map.getCenter().lat(), map.getCenter().lng(), DISTANCE_PROXI_POINT, 1); } else { HideMarkers(ArrayPlaces[1] )} }); ArrayPlacesCateg[200] = "Office de tourisme"; ArrayPlacesImg[200] = "/cartoV2/img/place_200.png"; ArrayPlaces[200] = new Array(); $('#s1_200').bind("click", {}, function () { if ($('#s1_200').is(':checked') && map.getZoom() >= 15) { AddProxiPlacesByLATLONCat(UID, map.getCenter().lat(), map.getCenter().lng(), DISTANCE_PROXI_POINT, 200); } else { HideMarkers(ArrayPlaces[200] )} }); } function closeTexts() { //on va fermer tous les autres arrêts var listStops = $('div[name=textDescription]'); var listMinus = $('.minus'); var listDescriptionStops= $('.descriptionStop') for(var i=0;i