X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fspip_carte_de_sites.git;a=blobdiff_plain;f=contenu%2Fpage-carte_de_sites.html;h=fbe71491c8464e49c6b5b87933316a1894a59b05;hp=560907985f2b47c8b894125b669552f5f3b4b65f;hb=53dfc2729557c149a413bf7b0b57a09ae825cb9f;hpb=d92e39e7946c012d04467ad2ec3e206cbaf1fea4
diff --git a/contenu/page-carte_de_sites.html b/contenu/page-carte_de_sites.html
old mode 100644
new mode 100755
index 5609079..fbe7149
--- a/contenu/page-carte_de_sites.html
+++ b/contenu/page-carte_de_sites.html
@@ -1,69 +1,110 @@
-
+[(#REM)
+ Modele carte_de_site
+
+ Parametres :
+ - fullscreen = non : afficher ou ne pas afficher le contrôle fullscreen
+ - legende = oui : afficher ou ne pas afficher la légende
+ - lat = 46.8 : latitude du centre de la carte
+ - lon = 2.52 : longitude du centre de la carte
+ - zoom = 5 : niveau de zoom (pour repère: 1 = la carte du monde; 15 = quartier)
+ - larg = 100% : largeur de la carte en pixel ou en pourcentage
+ - haut = 400 : hauteur de la carte en pixel ou en pourcentage
+ - style = 14189 : style de carte. Voir http://maps.cloudmade.com/editor . Si vous mettez en place une super carte pour les cyclistes, on est preneur.
+ - boite = oui : afficher ou pas la boite avec calques et types
+ - popup = oui : afficher ou pas les popups de description des ateliers
+ - images = oui : afficher ou pas les images (logo, photo de l'atelier)
+ - 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
+]
+
+
+
+
+
+
+
+
-
-
+
+ var group_#ID_MOT = new L.LayerGroup();
+ var templateIcon = L.Icon.extend({
+ options: {
+ iconUrl: '[(#LOGO_MOT||extraire_attribut{src}|url_absolue)]',
+ shadowUrl: '[(#LOGO_MOT_SURVOL||extraire_attribut{src}|url_absolue)]',
+ iconSize: new L.Point(17, 28),
+ shadowSize: new L.Point(17, 17),
+ iconAnchor: new L.Point(13, 17),
+ popupAnchor: new L.Point(0, -33)
+ }
+ });
+ gisIcon = new templateIcon()
+
+
+ var markerGis = new L.Marker(new L.LatLng(#LAT, #LON), {icon: gisIcon});
+ [(#ENV{popup}|!={non}|oui)
+ markerGis.bindPopup("[(#ENV{images}|!={non}|oui)]#TITRE
#DESCRIPTIF[(#ENV{images}|!={non}|oui)\]#ADRESSE
#CODE_POSTAL #VILLE
#NOM_SITE - #URL_SITE
Statut: [(#_mots_types:TITRE|supprimer_numero)]");
+ ]
+ group_#ID_MOT.addLayer(markerGis)
+
+
+
+ var cloudmadeAttribution = 'Map data © OpenStreetMap contributors
[(#ENV{lien}|!={non}|oui)(
<:carte_de_sites:grande_carte:>)]',
+ cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png';
+ var midnightCommander = new L.TileLayer(cloudmadeUrl, {styleId: 999, attribution: cloudmadeAttribution}),
+ thunderforest = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', {attribution: cloudmadeAttribution}),
+ minimal = new L.TileLayer(cloudmadeUrl, {styleId: [(#ENV{style}|sinon{'14189'})], attribution: cloudmadeAttribution});
-
Legende
-
- #LOGO_MOT [(#TITRE|supprimer_numero)]
-
+ //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(thunderforest);
+ [(#ENV{fullscreen}|oui)
+ map.addControl(new L.Control.FullScreen());
+ ]
+ //Ajout des marqueurs
+
+ map.addLayer(group_#ID_MOT);
+
+ [(#ENV{boite}|!={non}|oui)
+
+ ]
+
+ [(#ENV{loc}|!={oui}|non)
+ map.on('click', onMapClick);
+
+ var popup = new L.Popup();
+
+ function onMapClick(e) {
+ document.getElementById("#ENV{champ_lat}").value=e.latlng.lat.toFixed(18);
+ document.getElementById("#ENV{champ_lon}").value=e.latlng.lng.toFixed(18);
+ popup.setLatLng(e.latlng);
+ popup.setContent("<:carte_de_sites:coordonnees_clic:>");
+ map.openPopup(popup);
+ }
+ ]
+
+
+
-