X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=contenu%2Fpage-carte_de_sites.html;h=1485f288f5ee534f728d0a683b1d9786f9572460;hb=f1daffda184223b69ad85f93a263b512ac6fe2d1;hp=8d5347c6c14bde93e2bc4030a36a0b433ab75a76;hpb=3da7c94b7a71b394eac9271b611a35f7c345d3c2;p=lhc%2Fweb%2Fspip_carte_de_sites.git diff --git a/contenu/page-carte_de_sites.html b/contenu/page-carte_de_sites.html index 8d5347c..1485f28 100755 --- a/contenu/page-carte_de_sites.html +++ b/contenu/page-carte_de_sites.html @@ -15,6 +15,8 @@ - lien = oui : Lien automatique vers la grande carte - iframe = oui : Afficher ou non le lien vers le code iframe - loc = non : Afficher ou non le popup de localisation + - champ_lat : Prend l'identifiant d'une balise html en argument. Change la valeur (value) de cette balise par la latitude cliquee + - champ_lon : Prend l'identifiant d'une balise html en argument. Change la valeur (value) de cette balise par la longitude cliquee ] @@ -46,16 +48,17 @@ - var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade
[(#ENV{lien}|!={non}|oui)(<:carte_de_sites:grande_carte:>)]', + var cloudmadeAttribution = 'Map data © OpenStreetMap contributors
[(#ENV{lien}|!={non}|oui)(<:carte_de_sites:grande_carte:>)]', cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution}, cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png'; var midnightCommander = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 999}), + thunderforest = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', cloudmadeOptions), minimal = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: [(#ENV{style}|sinon{'14189'})]}); //Construction de la carte var map = new L.Map('map'); - map.setView(new L.LatLng([(#ENV{lat}|sinon{'46.8'})],[(#ENV{lon}|sinon{'2.52'})]),[(#ENV{zoom}|sinon{5})]).addLayer(minimal); + map.setView(new L.LatLng([(#ENV{lat}|sinon{'46.8'})],[(#ENV{lon}|sinon{'2.52'})]),[(#ENV{zoom}|sinon{5})]).addLayer(thunderforest); //Ajout des marqueurs @@ -73,10 +76,8 @@ var popup = new L.Popup(); function onMapClick(e) { - var latlngStr = '(' + e.latlng.lat.toFixed(18) + ',' + e.latlng.lng.toFixed(18) + ')'; - popup.setLatLng(e.latlng); - popup.setContent("<:carte_de_sites:coordonnees_clic:>" + latlngStr); - map.openPopup(popup); + document.getElementById("#ENV{champ_lat}").value=e.latlng.lat.toFixed(18); + document.getElementById("#ENV{champ_lon}").value=e.latlng.lng.toFixed(18); } ]