mapbox-gl-directions
mapbox-gl-directions copied to clipboard
Fix bug where re-adding component on style change fails
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 :)
Any updates on this fix?