Premier jet sur les ombres a partir du logo de survol
[lhc/web/spip_carte_de_sites.git] / contenu / page-carte_de_sites.html
1 <div id="map" style="width: 540px; height: 400px"></div>
2
3
4 <h2 class='h2 spip'>Legende</h2>
5 <BOUCLE_legende(MOTS){type = Ateliers}{par num titre}>
6 <p>#LOGO_MOT [(#TITRE|supprimer_numero)]</p>
7 </BOUCLE_legende>
8
9
10
11 <h2 class='h2 spip'>Ateliers</h2>
12 <BOUCLE_liste_pays(GIS){par pays}{fusion pays}>
13 <h3 class='h3 spip'>#PAYS</h3>
14 <BOUCLE_liste_region(GIS){par region}{pays}{fusion region}>
15 <h4 class='h4 spip'>#REGION</h4>
16 <BOUCLE_liste_ateliers(GIS){par ville}{region}>
17 <li>#VILLE (#CODE_POSTAL) #TITRE - #ADRESSE</li>
18 </BOUCLE_liste_ateliers>
19 </BOUCLE_liste_region>
20 </BOUCLE_liste_pays>
21
22 <script src="#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/leaflet.js"></script>
23 <script>
24 var map = new L.Map('map');
25
26 var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
27 cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
28 cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
29
30 map.setView(new L.LatLng(46.8, 2.52), 5).addLayer(cloudmade);
31
32 var WorkshopIcon = L.Icon.extend({
33 iconUrl: '#CONFIG{adresse_site}/plugins/carte-de-sites/images/grey.png',
34 shadowUrl: '#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/images/marker-shadow.png',
35 iconSize: new L.Point(25, 41),
36 shadowSize: new L.Point(41, 41),
37 iconAnchor: new L.Point(13, 41),
38 popupAnchor: new L.Point(0, -33)
39 });
40
41 <BOUCLE_ateliers_types(MOTS){type = Ateliers}{par num titre}>
42 <BOUCLE_sites(SITES){id_mot}>
43 <BOUCLE_coord(GIS){id_syndic}>
44 siteIcon = new WorkshopIcon('#CONFIG{adresse_site}/IMG/[(#LOGO_MOT|fichier)]','#CONFIG{adresse_site}/IMG/[(#LOGO_MOT_SURVOL|fichier)]')
45 var markerAtelier = new L.Marker(new L.LatLng(#LAT, #LON), {icon: siteIcon});
46 map.addLayer(markerAtelier);
47 markerAtelier.bindPopup("<a href='#URL_SITE'>#NOM_SITE</a><br/>#_sites:DESCRIPTIF<br/>#ADRESSE<br/> #CODE_POSTAL #VILLE<br/><br/><em>Statut: [(#_ateliers_types:TITRE|supprimer_numero)]</em>");
48 </BOUCLE_coord>
49 </BOUCLE_sites>
50 </BOUCLE_ateliers_types>
51
52
53 map.on('click', onMapClick);
54
55 var popup = new L.Popup();
56
57 function onMapClick(e) {
58 var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
59
60 popup.setLatLng(e.latlng);
61 popup.setContent("You clicked the map at " + latlngStr);
62 map.openPopup(popup);
63 }
64
65 </script>