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

Map reinitialization causes an error on drag #49

Open
nettiteeri opened this issue Mar 2, 2020 · 3 comments
Open

Map reinitialization causes an error on drag #49

nettiteeri opened this issue Mar 2, 2020 · 3 comments

Comments

@nettiteeri
Copy link

Steps to reproduce:
Tested on Windows 10 desktop Firefox.

  1. Initialize a map. For example: https://elmarquis.github.io/Leaflet.GestureHandling/examples
  2. run console command map.remove()
  3. Initialize map again with original init code
  4. Try to drag the map
  5. You'll get a TypeError null
@jwilliams-met
Copy link

Just stumbled into this issue. Worrying that theres been no response on this for nearly two year. @Corrodian , did you get any further in resolving this issue.

@elmarquis Bump

@nettiteeri
Copy link
Author

@jwilliams-met No I did not. The problem is still active on my site.

@jwilliams-met
Copy link

I resolved the issue for me by specifically checking if the gestureHandling handler is enable before disabling.
Just running causes other issues

e.g.

if (map.gestureHandling.enabled()) {
map.gestureHandling.disable()
}
map.remove()

Then once you reinitialise it works

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

No branches or pull requests

2 participants