AutomotiveCameraBehavior class abstract

Provides a high-level camera controller for automotive navigation that manages both tracking and area camera behaviors.

This class acts as a facade, delegating camera operations to either a TrackingCameraBehavior for following the vehicle during navigation or an AreaCameraBehavior for showing overview areas such as points of interest or route previews.

The controller supports three states: tracking mode (following the vehicle), area mode (showing geographic regions), or inactive (no automatic camera control). The inactive state allows external control of the camera, such as when responding to user touch events or when UI logic temporarily disables automatic camera behavior.

Camera configuration, including animation durations, zoom policies, and maneuver handling settings, can be provided through a JSON configuration string or file. The configuration is validated and parsed during construction.

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

Implemented types

Constructors

AutomotiveCameraBehavior()
Creates a new instance of this class with default camera behaviors and configuration.
factory
AutomotiveCameraBehavior.fromJson(String configJson)
Creates a new instance of this class configured from a JSON string.
factory

Properties

activeCameraType AutomotiveCameraBehaviorActiveCameraType
The active camera type. Defines which camera behavior is currently active: AutomotiveCameraBehaviorActiveCameraType.none (free navigation), AutomotiveCameraBehaviorActiveCameraType.tracking, or AutomotiveCameraBehaviorActiveCameraType.area. Gets the type of camera currently handling camera updates.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isManeuverDetectionEnabled ↔ bool
Enables or disables automatic camera adjustments during upcoming maneuvers. When enabled, the tracking camera automatically adjusts zoom and framing to provide better visibility of upcoming turns and maneuvers during navigation. The specific adjustments and their timing are defined in the camera configuration.
getter/setter pair
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
orientationMode AutomotiveCameraBehaviorOrientationMode
The current orientation mode of the camera. Defines the camera's viewing angle and orientation for tracking mode. In AutomotiveCameraBehaviorOrientationMode.mode2d, the camera looks straight down and rotates with the vehicle heading. In AutomotiveCameraBehaviorOrientationMode.mode3d, the camera is tilted for a perspective view. In AutomotiveCameraBehaviorOrientationMode.modeNorthUp, the camera maintains north-up orientation regardless of vehicle heading.
getter/setter pair
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. This property is forwarded to both the tracking and area cameras, ensuring consistent viewport constraints across all camera modes. If not set, it uses the viewport bounds of the underlying map view. Gets the current view rectangle, if it's set.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAreaCameraBehaviorGeobox(GeoBox geobox) → void
Configures the Area camera to frame the specified geographic bounding box.
setAreaCameraBehaviorVisiblePoints(List<GeoCoordinates> points, bool includeCurrentPosition) → void
Configures the Area camera to frame the specified points.
toString() → String
A string representation of this object.
inherited

Operators

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