Skip to main content

Camera

Adding Additional Points to the Camera Viewport

The Navigation SDK UX Framework allows you to include additional points that the camera should take into account when calculating the viewport.

These points do not override the current CameraState, instead, they are added to the existing set of camera-tracked points, ensuring that the specified locations are also visible within the current viewport.

For example, if the active CameraState is MarkersOverview and you also want to display the EV range map, you can use this feature to make sure the range map is included in the visible area alongside the markers that originally define the viewport.

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
Dash.controller.observeEvRangeMapState().collect { state ->
Dash.applyUpdate {
camera { additionalPointsToFrame = state.rangeMapFramePoints }
}
}
}
}
}

fun showEvRangeMapForMarkers(points: List<Point>) {
Dash.controller.showEvRangeMap()
}
}
Was this page helpful?