Skip to main content

Map Debug Options

The Mapbox Maps SDK offers some debug options which can be toggled on and off during development to troubleshoot visual map errors. These debug tools can be used to identify issues with camera orientation, tile loading, glyph and symbol collision, and more.

Debug options are for development only

These debug options may cause performance or visual issues. They are for debugging purposes only and should not be used in any production environment.

How to enable debug options

Developers can enable debug options by setting mapView’s debugOptions property with one MapViewDebugOption or an array of several MapViewDebugOptions, like below:

mapView.debugOptions = [.camera, .collision, .parseStatus, .modelBounds, .padding]

Available debug options

The following debug can be enabled or disabled at runtime and can be used together to identify issues with symbol placement, camera settings, 3D models, or other visual features.

Debug optionDescription
CameraShows a debug UIView with information about the CameraState including latitude, longitude, zoom, pitch, and bearing.
PaddingDraws the padding frame of the camera.
Tile bordersDraws the edges of tile boundaries as thick, red lines to help diagnose tile clipping issues.
Parse statusEach tile shows its tile coordinate (x/y/z) in the upper-left corner.
TimestampsEach tile shows a timestamp indicating when it was loaded.
CollisionShows the edges of glyphs and symbols as faint lines to help diagnose collision and label placement issues.
OverdrawReplaces each drawing operation with a translucent fill. Overlapping drawing operations appear more prominent to help diagnose overdrawing.
Stencil clipShows the stencil buffer instead of the color buffer.
Depth bufferShows the depth buffer instead of the color buffer.
Model boundsShows 3D model bounding boxes.
LightEach tile shows its local lighting conditions in the upper-left corner. (If lights properties are used, otherwise they show zero.)
Enable debug options

Enable and disabled debug options on a map.

Was this page helpful?