I'm trying to add some markers with specific Style and Popups, but if I use the PointToLayer function, onEachFeature is not called. So I can't add popup.
If I use only onEachFeature, I can use console.log(feature)
But I can't show markers. And if I use pointToLayer, onEachFeature is not called.
var json_chambre = L.geoJson(response, {
pointToLayer: function(feature, latlng) {
var markerCh = L.circleMarker(latlng, {
radius: 5,
fillColor: "#ff7800",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
});
chambre_pit.addLayer(markerCh);
},
onEachFeature: function(feature, layer) {
console.log(feature);
}
});
There is no errors, just I can't have popups and style at the same time.