With Leaflet, how have popup on each marker when I load geojson layer with Ajax?
var map = L.map('map', {
center: [44.3, -0.3],
zoom: 9
});
var my_layer_geoJson= new L.geoJson();
my_layer_geoJson.addTo(map);
$.ajax({
dataType: "json",
url: "geojson/data.php",
success: function(data) {
$(data.features).each(function(key, data) {
my_layer_geoJson.addData(data);
});
}
}).error(function() {});
Thank you ! Matthieu