Loading...
Searching...
No Matches
GuidanceCamera Class Referenceabstract

Drives the map camera from a RouteLayer and exposes the next instruction. Does not draw the route. More...

Inherits Finalizable.

Public Member Functions

void setMode (GuidanceCameraMode mode)
 Sets Free / Following / Overview.
 
GuidanceCameraMode mode ()
 Current mode.
 
void set2DMode (bool enabled)
 Forces a top-down camera (tilt 0) in Following and Overview. When false, Following uses a fixed forward tilt.
 
bool is2DMode ()
 Returns true when top-down guidance is enabled.
 
void setActive (bool active)
 When false, the camera is not moved. Instructions still update.
 
bool isActive ()
 Returns true when this controller may move the camera.
 
RouteInstruction instruction ()
 Latest next instruction, or null.
 
void addListener (GuidanceListener listener)
 Adds a listener for mode and instruction changes.
 
void removeListener (GuidanceListener listener)
 Removes a previously added listener.
 
bool isValid ()
 

Detailed Description

Drives the map camera from a RouteLayer and exposes the next instruction. Does not draw the route.

Overview uses the window focus rect, so set LocationWindow.focusRect for chrome (floor selector, banner) before switching to OVERVIEW.

Referenced from NavigineSdk.

Definition at line 30 of file guidance_camera.dart.

Member Function Documentation

◆ addListener()

void GuidanceCamera.addListener ( GuidanceListener listener)

Adds a listener for mode and instruction changes.

Dart apps implement GuidanceListener and pass it to addListener.

◆ instruction()

RouteInstruction GuidanceCamera.instruction ( )

Latest next instruction, or null.

Dart code snippet:

final next = _guidanceCamera?.instruction();
print('Next instruction: ${next?.title} ${next?.distance} m');

◆ is2DMode()

bool GuidanceCamera.is2DMode ( )

Returns true when top-down guidance is enabled.

◆ isActive()

bool GuidanceCamera.isActive ( )

Returns true when this controller may move the camera.

◆ isValid()

bool GuidanceCamera.isValid ( )

◆ mode()

GuidanceCameraMode GuidanceCamera.mode ( )

Current mode.

Dart code snippet:

print('Guidance mode: ${_guidanceCamera?.mode()}');

◆ removeListener()

void GuidanceCamera.removeListener ( GuidanceListener listener)

Removes a previously added listener.

◆ set2DMode()

void GuidanceCamera.set2DMode ( bool enabled)

Forces a top-down camera (tilt 0) in Following and Overview. When false, Following uses a fixed forward tilt.

Dart code snippet:

_guidanceCamera?.set2DMode(false);

◆ setActive()

void GuidanceCamera.setActive ( bool active)

When false, the camera is not moved. Instructions still update.

◆ setMode()

void GuidanceCamera.setMode ( GuidanceCameraMode mode)

Sets Free / Following / Overview.

Dart code snippet:

_guidanceCamera?.setMode(GuidanceCameraMode.FOLLOWING);

The documentation for this class was generated from the following file: