Skip to content

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

Open
andrewharvey wants to merge 1 commit intomapbox:masterfrom
andrewharvey:patch-1
Open

ensure style is updated when control is added after the style is already loaded#52
andrewharvey wants to merge 1 commit intomapbox:masterfrom
andrewharvey:patch-1

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