Load geoJson in MapBox for editing with Leaflet.Draw

geojson, leaflet, mapbox

Solution

I have found the solution :

L.geoJson(geojson, {
  onEachFeature: function (feature, layer) {
    featureGroup.addLayer(layer);
  }
});

Problem

I try to load geoJson data in Mapbox and edit it with the plugin Leaflet.Draw Here is an example : fiddle ``` var featureGroup = L.featureGroup().addTo(map); var geojson = { "type": "FeatureCollection", "features": [ ........... ] } L.geoJson(geojson).addTo(featureGroup); ``` When i click to the edit button, i have an error : Uncaught TypeError: Cannot read property 'enable' of undefined Object seems to be editable but i can't modify it. What is the correct way to add geojson object in mapbox draw layer ?

Original source