Skip to content

Commit

Permalink
Merge pull request #1 from pascalpvk/Interrogation-des-attributs
Browse files Browse the repository at this point in the history
onEachFeature des Departement
  • Loading branch information
pascalpvk authored Apr 7, 2022
2 parents 72f226d + d8d5d3c commit 1ef804d
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,37 @@ <h2>Pour aller plus loin</h2>
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors,'}).addTo(map);

//Ajout du layer GeoJSON Département
var DEPARTEMENTS = L.geoJson(deps_idf, {
// var DEPARTEMENTS = L.geoJson(deps_idf, {
// style: function (feature) {
// return {
// weight: feature.properties.radius_qgis2leaf,
// color: feature.properties.color_qgis2leaf,
// opacity: feature.properties.transp_qgis2leaf,
// fillOpacity: feature.properties.transp_qgis2leaf
// };
// }
// });
// DEPARTEMENTS.addTo(map);


// DEPARTEMENTS
//fonction popup
function onEachFeature(feature, layer) {
if (feature.properties) {
layer.bindPopup("<b>" + feature.properties.CODE_DEPT + "</b><br>" + feature.properties.NOM_DEPT);
}
}
//Ajout du layer GeoJSON Departements IDF
var deps_idf_var = new L.geoJson(deps_idf,{
onEachFeature: onEachFeature,
style: function (feature) {
return {
weight: feature.properties.radius_qgis2leaf,
color: feature.properties.color_qgis2leaf,
opacity: feature.properties.transp_qgis2leaf,
fillOpacity: feature.properties.transp_qgis2leaf
};
}
});
DEPARTEMENTS.addTo(map);
return {color: feature.properties.border_color_qgis2leaf,
fillColor: feature.properties.color_qgis2leaf,
weight: feature.properties.radius_qgis2leaf,
opacity: feature.properties.transp_qgis2leaf,
fillOpacity: feature.properties.transp_qgis2leaf};
} });
deps_idf_var.addTo(map);

L.geoJson(RERA, { }).addTo(map);
//Ajout du layer GeoJSON RER A
Expand Down Expand Up @@ -209,13 +229,6 @@ <h2>Pour aller plus loin</h2>
airports.addTo(map);


//fonction popup
function onEachFeature(feature, layer) {
if (feature.properties) {
layer.bindPopup("<b>" + feature.properties.CODE_DEPT + "</b><br>" + feature.properties.NOM_DEPT);
}
}


</script>

Expand Down

0 comments on commit 1ef804d

Please sign in to comment.