TransitionCameraBehavior class abstract

Provides a generic dynamic camera behavior that transitions between two pre-configured camera behaviors based on lane detection and data consistency.

This allows for optimized camera positioning depending on whether high-definition lane data is available or not.

The camera will automatically switch between two pre-configured camera behaviors (HD and SD) based on the current navigation context and data consistency. This is a generic base class that works with any CameraBehavior types, allowing transitions between different camera behavior implementations.

Transition criteria:

  • SD -> HD: switches to HD when at least CameraHdTransition.minimumHdLengthInMeters of consecutive HD lane data is available ahead AND the route carpet is currently being rendered.
  • HD -> SD: switches back to SD when HD lane data runs low AND a real non-HD boundary exists ahead AND the minimum HD duration has been traveled.
  • HD is forced off when the route carpet data is not shown (e.g. carpet generation failure or missing layers) to avoid presenting an HD camera without HD visuals.
  • HD stays on when approaching the end of the route with only HD data remaining (no non-HD boundary), regardless of remaining distance.

Construction-zone awareness: Traffic incidents of type CONSTRUCTION are taken into account at span level. When the algorithm looks ahead for the next CameraHdTransition.minimumHdLengthInMeters of HD data, any route span tagged with a CONSTRUCTION incident is treated as a non-HD boundary, because lane data is typically unreliable across construction zones. The effective HD coverage ahead is capped at the start of the nearest construction span, so the same CameraHdTransition.minimumHdLengthInMeters threshold drives the resulting SD<->HD transition. HD mode therefore always guarantees at least CameraHdTransition.minimumHdLengthInMeters of dependable HD data ahead: when a construction zone falls within that window, the camera switches back to SD immediately, bypassing the usual minimum HD travel distance even if HD was just entered. The lookahead is intentionally span-scoped (not section-scoped), so a single distant incident does not block HD over long stretches of the route.

Note: TransitionCameraBehavior cannot be nested - the hd_camera_behavior and sd_camera_behavior parameters must not be instances of TransitionCameraBehavior.

Note: This is a beta release of this feature and may contain bugs or exhibit unexpected behaviour. Related APIs are subject to change without a deprecation process.

Implemented types

Constructors

TransitionCameraBehavior.make(CameraBehavior hdCameraBehavior, CameraBehavior sdCameraBehavior, int minimumHdLengthInMeters)
Creates a new instance of this class.
factory
TransitionCameraBehavior.withRecommendedConfiguration()
Creates a new instance of this class following the recommended configuration.
factory

Properties

cameraTransitionMode ↔ CameraTransitionMode
Defines how the camera starts following the current position when this camera behavior becomes active. Use CameraTransitionMode.instant to skip the camera animation, for example when returning from a route overview to guidance. The default value is CameraTransitionMode.animated. Gets the currently set camera transition mode.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
minimumHdLengthInMeters ↔ int
Minimum HD lane data length threshold in meters. The camera transitions from HD to SD mode when HD lane data availability falls below this distance ahead, or transitions to HD mode when sufficient HD data is detected. Gets the minimum HD length in meters.
getter/setter pairinherited
normalizedPrincipalPoint ↔ Anchor2D
The normalized principal point. Normalized principal point to be used during navigation. Defaults to (0.5, 0.775), which means the camera will use the position slightly at the bottom of the mapview. Gets the currently set normalized principal point to be used during navigation.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
viewRectangle ↔ Rectangle2D?
The view rectangle for camera updates. Defines a sub-space of the screen that the behavior should consider for camera updates. Using a view rectangle keeps the camera positioning consistent across different screen types and orientations without per-screen principal point adjustments. Defaults to null. If not set, it uses the viewport bounds of the underlying map view. Gets the current view rectangle, if it's set.
getter/setter pairinherited

Methods

getHdCameraBehavior() → CameraBehavior
Gets the HD camera behavior configuration.
getSdCameraBehavior() → CameraBehavior
Gets the SD camera behavior configuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setHdCameraBehavior(CameraBehavior hdCameraBehavior) → void
Sets the HD camera behavior configuration.
setSdCameraBehavior(CameraBehavior sdCameraBehavior) → void
Sets the SD camera behavior configuration.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited