MapboxNavigationViewportDataSourceDebugger

class MapboxNavigationViewportDataSourceDebugger @JvmOverloads constructor(context: Context, mapView: MapView, layerAbove: String? = null)

This feature is currently experimental an subject to change.

Draw various info on the screen when the NavigationCamera operates to together with the MapboxNavigationViewportDataSource. This info includes:

  • Green Box, which is the padding applied by the developer for framing purposes.

  • Black Box, which is the padding applied to the Map instance.

  • Red Box, which is the Map's camera center.

  • Light Blue Line, which shows the framed geometries.

Example

Make sure to also provide the same debugger instance to NavigationCamera.debugger and MapboxNavigationViewportDataSource.debugger.

val debugger = MapboxNavigationViewportDataSourceDebugger(
context,
mapView
).apply {
enabled = true
}
viewportDataSource = MapboxNavigationViewportDataSource(
mapView.getMapboxMap()
)
viewportDataSource.debugger = debugger
navigationCamera = NavigationCamera(
mapView.getMapboxMap(),
mapView.camera,
viewportDataSource
)
navigationCamera.debugger = debugger

Parameters

layerAbove

layer in the current map style above which the debug layer with framed geometries should be placed

Constructors

constructor(context: Context, mapView: MapView, layerAbove: String? = null)

Properties

Link copied to clipboard

Use to show/hide the debug info.