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 bug where re-adding component on style change fails #236

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

Conversation

jonathonwpowell
Copy link

The goal of this PR is to fix #190

Currently if a user of Mapbox GL JS is using this component and they want to switch styles, they need to remove and re-add the directions component. But due to how the onAdd function works, it will not trigger the re-addition of some styles, as it will wait for a load event that will never come. Instead this subscribes to the idle event and then unsubscribes itself once it has triggered.

Please let me know if I can improve the PR in any way :)

@xiaofanliang
Copy link

Any updates on this fix?

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.

Changing map style causes plugin to throw errors
2 participants