MapboxNavigationViewportDataSourceDebugger

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

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

fun MapboxNavigationViewportDataSourceDebugger(context: Context, mapView: MapView, layerAbove: String? = null)
layer in the current map style above which the debug layer with framed geometries should be placed

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String

Properties

enabled
Link copied to clipboard
var enabled: Boolean = false
Use to show/hide the debug info.