Skip to content

feat: add native onCameraChanged throttling to MapView#4193

Open
ciospettw wants to merge 1 commit intornmapbox:mainfrom
ciospettw:feat/camera-changed-throttle
Open

feat: add native onCameraChanged throttling to MapView#4193
ciospettw wants to merge 1 commit intornmapbox:mainfrom
ciospettw:feat/camera-changed-throttle

Conversation

@ciospettw
Copy link
Copy Markdown

@ciospettw ciospettw commented Apr 3, 2026

Description

Fixes #4192

Added cameraChangedThrottleInterval to MapView so apps can opt into native throttling for onCameraChanged during gesture-heavy interactions.

The default remains 0, so existing behavior is unchanged unless the new prop is explicitly set.

This PR also updates the Map Handlers example and synchronizes the related docs so the new prop is discoverable and easy to validate.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

Not included.

Component to reproduce the issue you're fixing

<MapView
  cameraChangedThrottleInterval={250}
  onCameraChanged={(state) => {
    // Throttled intermediate camera updates.
  }}
  onMapIdle={(state) => {
    // Final settled camera state.
  }}
/>

Notes

  • cameraChangedThrottleInterval is fully opt-in and defaults to 0, so omitting it preserves the current event behavior.
  • I manually synchronized docs/MapView.md and docs/examples.json in this checkout.
  • I left the yarn generate checklist item unchecked because node .yarn/releases/yarn-3.6.1.cjs generate currently fails locally in this environment with TypeError: Yallist is not a constructor from hosted-git-info on Node 22.
  • Targeted validation completed: jest __tests__/components/MapView.test.js passes.

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.

[Bug]: dense onCameraChanged traffic during gestures can overwhelm JS without a native throttle

1 participant