Skip to content

feat(MapView): add debugOptions prop - #4427

Merged
mfazekas merged 1 commit into
mainfrom
feat/mapview-debug-options
Oct 29, 2026
Merged

mfazekas merged 1 commit into
mainfrom
feat/mapview-debug-options

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

Description

Added a debugOptions prop on MapView that turns on the native debug drawings of the Mapbox SDKs, e.g. debugOptions={['tileBorders', 'collision']} (similar to GL JS showTileBoundaries/showCollisionBoxes).

The names come from the public MapView.debugOptions APIs of the SDK versions we ship (11.33.0). Shared: tileBorders, parseStatus, timestamps, collision, overdraw, stencilClip, depthBuffer, modelBounds, light, camera, padding. Android only: terrainWireframe, layers2DWireframe, layers3DWireframe; iOS ignores them with a warning. Unknown names log a warning and are ignored. Changes apply live, survive styleURL changes, and an empty array or removing the prop turns everything off. On Android the map view is relaid out after a change, otherwise the camera and padding overlay views stay at 0x0.

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

Verified with the new Map > Debug Options example on an iOS 26.5 simulator and an Android emulator: no drawing without the prop, tile borders and collision boxes toggle live, parseStatus/overdraw/camera/padding draw, options stay after switching to the Dark style, and the prop removal and [] both clear. Warnings seen in the logs:

iOS:     warn | RNMBXMapView | debugOptions: terrainWireframe is only supported on Android, ignored
iOS:     warn | RNMBXMapView | debugOptions: unknown option bogusOption, ignored
Android: W RNMBXMapView: debugOptions: unknown option bogusOption, ignored

Exposes the native map debug drawings (tile borders, collision boxes,
overdraw, camera and padding views, ...) as debugOptions={['tileBorders']}.
@mfazekas
mfazekas marked this pull request as ready for review October 29, 2026 10:54
@mfazekas
mfazekas merged commit 7821ae6 into main Oct 29, 2026
10 checks passed
@mfazekas
mfazekas deleted the feat/mapview-debug-options branch October 29, 2026 10:55

This branch was successfully deployed

1 active deployment
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.

1 participant