Closed aborruso closed 10 years ago
I'll make an example to demonstrate this, but the short answer is (code not tested, but should work):
function eachLayer(layer) {
var feature = layer.toGeoJSON();
if (feature.properties && feature.properties.mypop) {
layer.bindPopup(feature.properties.mypop);
}
}
var points = omnivore.geojson('poi.geojson')
.on('ready', function() {
map.fitBounds(points.getBounds());
map.addLayer(points );
points.eachLayer(eachLayer);
});
Hi @tmcw it works: http://aborruso.github.io/mapbox_csv
Thank you very much
Hi, each function returns an L.geoJson object, but I'm not able to use onEachFeature to have a popup for each marker of my maps.
I have tested the below code, but it does not work.
How to have a popup for an omnivore marker?
Thank you