Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers are draggable after drawing a new marker #1113

Open
Falke-Design opened this issue Feb 21, 2022 · 2 comments
Open

Markers are draggable after drawing a new marker #1113

Falke-Design opened this issue Feb 21, 2022 · 2 comments
Labels

Comments

@Falke-Design
Copy link
Collaborator

    var marker1 = L.marker(
        [5, 5],
    ).addTo(map);
    
    marker1.pm.setOptions({draggable: false});

Because of the markerEditable option, other existing markers are going into edit mode and keeping that for the drag mode

#1105

@jayli3n
Copy link

jayli3n commented Apr 6, 2023

im also experiencing the same behaviour. If you set draggable to false:

marker1.pm.setOptions({draggable: false});

and then go into edit mode, and then drag mode, you can drag the marker around :(

From what ive noticed, the marker pm options.draggable gets reset back to whatever is set at globalOptions.

@Falke-Design
Copy link
Collaborator Author

Workaround, apply this to the layer:

layer.on('pm:enable',()=>{
    layer.pm.setOptions({draggable: false});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants