[carte] optimisation des marqueurs
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Tue, 5 Feb 2013 12:40:53 +0000 (13:40 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Tue, 5 Feb 2013 12:40:53 +0000 (13:40 +0100)
contenu/page-carte_de_sites.html

index 2b0d794..7a2599e 100755 (executable)
 <script>
     <BOUCLE_mots_types(MOTS){type = (#ENV{groupe})}>
          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()
          <BOUCLE_sites(SITES){id_mot}>
                <BOUCLE_coord(GIS){id_syndic}>
-               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)<span style='float: left; width: 45px;'><img src='[(#LOGO_SYNDIC||extraire_attribut{src}|url_absolue)]' alt='' style='width: 45px;' width='45'></span>]<h4>#TITRE</h4>#DESCRIPTIF[(#ENV{images}|!={non}|oui)<span class='spip_documents spip_documents_right' style='float: right; width: 100px;'>\<img src='[(#LOGO_SYNDIC_SURVOL||extraire_attribut{src}|url_absolue)]' alt='' style='width: 100px;' width='100'></span>]#ADRESSE<br/> #CODE_POSTAL #VILLE<br/><a href='#URL_SITE' target='_blank'>#NOM_SITE - #URL_SITE</a><br/><br/><em>Statut: [(#_mots_types:TITRE|supprimer_numero)]</em>");