Is it okay to use imperative method such as flyTo
in a controlled map?
#2294
-
I'm using a controlled map where I passed in the view state via props. In my case, I want to achieve a change in view position with some animation like the behavior of a I just wondering if it okay to use imperative method such as |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you call https://visgl.github.io/react-map-gl/docs/api-reference/map#onmove |
Beta Was this translation helpful? Give feedback.
-
Got it @Pessimistress |
Beta Was this translation helpful? Give feedback.
If you call
flyTo
on a controlled map,onMove
will be invoked as the map attempts to animate its camera. Your app is responsible of listening to the event and update the props.https://visgl.github.io/react-map-gl/docs/api-reference/map#onmove