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

Fix for deprecation of _drawnLayers in Canvas as of Leaflet 1.4.0 #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryanhausen
Copy link

As Leaflet 1.4.0 the attribute _drawnLayers no longer exists for Canvas objects (see change log here), so when a map uses the Canvas renderer, ellipse markers throw an exception. The error can be reproduced on the example website by changing the leaflet version to 1.4.0 and adding preferCanvas: true to the map options.

The change checks for _drawnLayers if that doesn't exist checks for _layers, and if tha doesn't exist, throws an error.

This has worked both leaflet<1.4.0 and 1.4.0<=leaflet<=1.8.0 in my testing.

@redzapdos
Copy link

This looks like it fixes the issue I just observed as well, thank you! Hopefully this can get merged and up to npm

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

Successfully merging this pull request may close these issues.

2 participants