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

Error when calling onRemove if the creation failed #147

Open
gavinr opened this issue Sep 2, 2022 · 0 comments
Open

Error when calling onRemove if the creation failed #147

gavinr opened this issue Sep 2, 2022 · 0 comments

Comments

@gavinr
Copy link
Contributor

gavinr commented Sep 2, 2022

Describe the bug

From @corrigancd in #140:

When a layer fails to load, even if the error is handled (#146), in our app there is a function which calls leafletMap.removeLayer to clear layers before re-adding them. This triggers the onRemove function in vectorTileLayer and map.removeLayer(this._mapboxGL) was called. The the problem was that this._mapboxGL was never initialized because the _createLayer function was exited early. So a check was added to make use that this.mapboxGL exists before calling remove.

Reproduction

tbd ... I'll try to follow up with this, or @corrigancd are you able to provide reproduction steps?

Logs

tbd

System Info

coming soon

Additional Information

Proposed solution from @corrigancd in #140: https://github.com/Esri/esri-leaflet-vector/pull/140/files#diff-d87a7a0181c4fb7f5a10b32e3494597f82c320b55306aa848df45d586513b30eR144-R146

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

1 participant