I can add Geojson layer to a leaflet map using angular leaflet directive.
I can also add the leaflet Draw control and create new layers (polygons, polylines etc.)
However, there appears to be no straight forward way to enable editing of the GeoJSON layer loaded by the directive.
The code looks something like this:
angular.extend($scope, {
controls: {
draw: {}
},
geojson: {
...........
...........
}
});
.....
.....
<leaflet center="london" controls="controls" geojson="geojson"></leaflet>
However when I try to edit the layer or create new layers, the changes happen in a different layer group. For example, after the GeoJSON is loaded, if I click on edit button, none of the items loaded via GeoJSON become editable.
I want the draw control to be bound to the GeoJSON object that was specified in the directive. The objective is to have any modification via the UI reflect immediately in the geojson object and vice versa. In other words I want to have two way binding between the edit control and the geojson object.