Outils pour utilisateurs

Outils du site


geo_data:associations_map_js

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
Prochaine révision Les deux révisions suivantes
geo_data:associations_map_js [31/07/2016 20:32]
cyrille37
geo_data:associations_map_js [21/08/2020 14:46]
administrateur
Ligne 1: Ligne 1:
 +<script>
 /** /**
  * Javascript pour construire la carte.  * Javascript pour construire la carte.
Ligne 5: Ligne 6:
  * - Leaflet.markercluster  * - Leaflet.markercluster
  */  */
 +"use strict";
  
   var dataFiles = {   var dataFiles = {
Ligne 12: Ligne 14:
    cucsLayer : '/_media/geo_data/cucs_wgs84.geo.json' ,    cucsLayer : '/_media/geo_data/cucs_wgs84.geo.json' ,
    irisLayer: '/_media/geo_data/agglo_tours_iris2.geo.json',    irisLayer: '/_media/geo_data/agglo_tours_iris2.geo.json',
-   qppv2015: '/geo_data/quartiers-prioritaires-2015_wgs84_geojson?do=export_text'+   qppv2015: '/geo_data/quartiers-prioritaires-2015_wgs84_geojson?do=export_raw'
    //epnsLayer: '/_media/geo_data/espace-public-numerique-epn_37.geocode.geo.json'    //epnsLayer: '/_media/geo_data/espace-public-numerique-epn_37.geocode.geo.json'
   };   };
Ligne 65: Ligne 67:
  epnsLayer.addData(data);  epnsLayer.addData(data);
  });  });
-  +  
- console.log('qppvLayer');+
  var qppvLayer = L.geoJson(null, {  var qppvLayer = L.geoJson(null, {
    //onEachFeature : cucs_onEachFeature,    //onEachFeature : cucs_onEachFeature,
-   style : iris_style+   style : qppv_style
  });  });
- jQuery.getJSON( dataFiles.qppv2015, {dataType:'json'}, function( data)+ jQuery.getJSON( dataFiles.qppv2015 
 +        .done( function( data)
  {  {
- console.log('qppvLayer.addData: '); +   qppvLayer.addData(data);
- console.log(data); +
- qppvLayer.addData(data);+
  });  });
                  
Ligne 84: Ligne 84:
      "QPPV 2015" : qppvLayer ,      "QPPV 2015" : qppvLayer ,
      "Assos" : assosLayer,      "Assos" : assosLayer,
-     'EPNs assos <img src="http://savoirscom1.comptoir.net/_media/geo_data/arobase-black_25x26.png" width="14px"/>' : epnsLayer+     'EPNs assos <img src="http://savoirscommuns.comptoir.net/_media/geo_data/arobase-black_25x26.png" width="14px"/>' : epnsLayer
    }    }
    var tilesOsmFr = L    var tilesOsmFr = L
Ligne 254: Ligne 254:
   var EpnIcon = L.Icon.extend({   var EpnIcon = L.Icon.extend({
     options: {     options: {
-  iconUrl: 'http://savoirscom1.comptoir.net/_media/geo_data/arobase-black_25x26.png',+  iconUrl: 'http://savoirscommuns.comptoir.net/_media/geo_data/arobase-black_25x26.png',
       iconSize:     [25,26],       iconSize:     [25,26],
       iconAnchor:   [0,0],       iconAnchor:   [0,0],
Ligne 260: Ligne 260:
     }     }
   });   });
 +  
 +  function qppv_style( feature) {
 +    return {
 +      fillColor : 'green',
 +      fillOpacity : 0.4,
 +      weight : 3,
 +      opacity : 1,
 +      color : 'black',
 +      dashArray : '2'
 +    };
 +  }
      
   function iris_style( feature)   function iris_style( feature)
Ligne 281: Ligne 292:
      */      */
   }   }
-   
-  mapInit(); 
-   
  
 +// Native "document loaded" event (aka famous JQuery `$(function(){})`).
 +document.addEventListener('DOMContentLoaded', mapInit, false);
 +
 +  
 +</script>
geo_data/associations_map_js.txt · Dernière modification: 21/08/2020 14:46 de administrateur