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

With opt-in pmIgnored: false is required on map creation to set up map.pm. This is not specified in the docs. #950

Closed
main-kun opened this issue Jul 6, 2021 · 3 comments · Fixed by #951
Labels
fixed Issues that are fixed in develop or in a PR

Comments

@main-kun
Copy link
Contributor

main-kun commented Jul 6, 2021

function initMap() {
this.pm = undefined;
if (L.PM.optIn) {
if (this.options.pmIgnore === false) {
this.pm = new L.PM.Map(this);
}
} else if (!this.options.pmIgnore) {
this.pm = new L.PM.Map(this);
}
}

When opt in is set to true before a map is created { pmIgnored: false } is required in options. Otherwise map.pm is undefined. This is not mentioned in the docs.

main-kun added a commit to main-kun/leaflet-geoman that referenced this issue Jul 6, 2021
@main-kun
Copy link
Contributor Author

main-kun commented Jul 6, 2021

I've opened a pull request that adds a line about it in the docs: #951. However i was surprised to find out that when opt in is enabled newly drawn objects cannot be edited too. Is this by design? How can i enabled opt-in and at the same time allow editing new layers?

@Falke-Design
Copy link
Collaborator

Yes this is the expected behaviour
https://github.com/geoman-io/leaflet-geoman#opt-in

All layers will be ignored by Leaflet-Geoman, unless you specify pmIgnore: false on a layer

But you can add in your PR something like "layers will be also ignored if they are newly drawn"

@Falke-Design
Copy link
Collaborator

Fixed with Release 2.11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issues that are fixed in develop or in a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants