rodolpheg

Untitled

Feb 3rd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. // Fonction ajoutant des "listener" à la couche
  2. function ajouter_interaction(feature, layer) {
  3. layer.on({
  4. mouseover: surligneEntite,
  5. mouseout: resetStyleEntite,
  6. click: zoomSurEntite
  7. });
  8. }
  9.  
  10. // Importation d'une couche GeoJSON grâce au plugin "leaflet-ajax"
  11. // Utilisation de onEachFeature pour attribuer une fonction à chaque entité : https://leafletjs.com/reference-1.6.0.html#geojson-oneachfeature
  12. var poly = new L.GeoJSON.AJAX('Montreal_v0743.json', {style: style_par_entite, onEachFeature: ajouter_interaction});
Advertisement
Add Comment
Please, Sign In to add comment