I can't seem to have much luck chaining a rotateTo transition after a flyTo transition, here are 2 examples the first one chains another flyTo transition after the 'moveend' event is fired, this works but if I try to rotate instead, no luck. Am I trying to do something silly?
[GIS] Rotate Mapbox GL JS map after flyTo transition
mapbox-gl-js
Best Answer
I tried your rotate after transition example, and saw the same error you encountered (only
flyTo
operation works,rotateTo
did not).But when I swapped the operations (
map.rotateTo()
first, thenmap.flyTo()
), then I was able to get both operations to work.I see that #2855 has been filed in mapbox-gl-js.
It may not fit into your workflow, but it appears that you can achieve both operations by swapping. Then awaiting the response from Mapbox on Github issues.
This works
This did not