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

ensure style is updated when control is added after the style is already loaded #52

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

Conversation

andrewharvey
Copy link

map.on('style.load') is only called if registered before the style resource has loaded, so in the case that the control is added to the map after the style resource has already loaded it won't trigger. Therefore within control onAdd we should check if the map style resource is already loaded and if so immediately trigger the initialStyleUpdate.

…ady loaded

`map.on('style.load')` is only called if registered before the style resource has loaded, so in the case that the control is added to the map after the style resource has already loaded it won't trigger. Therefore within control `onAdd` we should check if the map style resource is already loaded and if so immediately trigger the `initialStyleUpdate`.
@teenageknight
Copy link

+1 on this

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