1 year ago

#67805

test-img

fairlyMinty

Edit and Delete doesn't work for Angular Leaflet

I am trying to edit and delete the shapes that I draw on the leaflet map. However, when I active the edit or draw, nothing happens and I am unable to edit the shape. I am currently importing leaflet and leaflet-draw into my application:

import * as L from 'leaflet';
import 'leaflet-draw';

And this is how my code looks like:

edit() {
    let edit = new L.EditToolbar.Edit(map, {
        featureGroup: featureGroupOptions,
        selectedPathOptions: {},
    } as any);
}

delete() {
    let delete= new L.EditToolbar.Delete(map, {
        featureGroup: featureGroupOptions
    } as any);
}

The map shows that I can edit or delete the polygon but I can't actually drag the vertexes nor delete the polygon. Am I doing something wrong? Any help is greatly appreciated!

angular

leaflet

leaflet.draw

ngx-leaflet

leaflet-draw

0 Answers

Your Answer

Accepted video resources