Overview
TheCameraGestureObserver is a unified native observer optimized for detecting when the map reaches a steady state after camera movements, gestures, or animations. This is useful for triggering actions after the user has finished interacting with the map.
Import
Props
Time in milliseconds to wait after the last camera change before emitting the ‘steady’ event. The timer resets with each camera movement.
Maximum time in milliseconds before emitting a ‘timeout’ event during continuous camera activity. Useful for detecting prolonged gestures or animations.
Callback fired when the map reaches a steady state (no active gestures or animations for the duration specified by
quietPeriodMs).Signature: (event: { nativeEvent: OnMapSteadyEvent }) => voidThe event object contains:timestamp: When the steady state was detectedcameraBounds: Current camera boundscameraCenter: Current camera center coordinate
Usage
Basic Usage
With Custom Timeout
Trigger Actions on Steady
Use Cases
- Performance optimization: Load data only after the user stops panning/zooming
- Analytics: Track when users finish exploring a region
- Auto-save: Save map state after user finishes adjusting view
- Lazy loading: Defer expensive operations until the map is stable
- Search: Trigger “search this area” after map movement stops
Notes
- The observer is highly optimized at the native level for minimal performance impact
- The
quietPeriodMstimer resets on every camera change - This component must be a child of
MapView - Multiple observers can be used in the same MapView if needed