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.
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:
Map()
.debugOptions([.camera, .collision, .parseStatus, .modelBounds, .padding])
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 option | Description |
---|---|
Camera | Shows a debug UIView with information about the CameraState including latitude, longitude, zoom, pitch, and bearing. |
Padding | Draws the padding frame of the camera. |
Tile borders | Draws the edges of tile boundaries as thick, red lines to help diagnose tile clipping issues. |
Parse status | Each tile shows its tile coordinate (x/y/z) in the upper-left corner. |
Timestamps | Each tile shows a timestamp indicating when it was loaded. |
Collision | Shows the edges of glyphs and symbols as faint lines to help diagnose collision and label placement issues. |
Overdraw | Replaces each drawing operation with a translucent fill. Overlapping drawing operations appear more prominent to help diagnose overdrawing. |
Stencil clip | Shows the stencil buffer instead of the color buffer. |
Depth buffer | Shows the depth buffer instead of the color buffer. |
Model bounds | Shows 3D model bounding boxes. |
Light | Each tile shows its local lighting conditions in the upper-left corner. (If lights properties are used, otherwise they show zero.) |
Enable and disabled debug options on a map.