Loading...
Searching...
No Matches

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

#include <com/navigine/idl/objc/NCGuidanceCamera.h>

Inherits NSObject.

Instance Methods

(void) - setMode:
 Sets Free / Following / Overview.
 
(NCGuidanceCameraMode) - mode
 Current mode.
 
(void) - set2DMode:
 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:
 When false, the camera is not moved. Instructions still update.
 
(BOOL) - isActive
 Returns true when this controller may move the camera.
 
(nullable NCRouteInstruction *) - instruction
 Latest next instruction, or null.
 
(void) - addListener:
 Adds a listener for mode and instruction changes.
 
(void) - removeListener:
 Removes a previously added listener.
 

Properties

BOOL valid
 

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 26 of file NCGuidanceCamera.h.

Method Documentation

◆ addListener:

- (void) addListener: (nullable id< NCGuidanceListener >) listener

Adds a listener for mode and instruction changes.

Swift and Objective-C apps implement NCGuidanceListener and pass self to addListener:, the same way NCRouteLayerListener is attached.

◆ instruction

- (nullable NCRouteInstruction *) instruction

Latest next instruction, or null.

Swift code snippet:

if let next = guidanceCamera?.instruction() {
print("Next instruction: \‍(next.title ?? "") \‍(next.distance) m")
}

Objective C code snippet:

NCRouteInstruction *next = [self.guidanceCamera instruction];
if (next) {
NSLog(@"Next instruction: %@ %.0f m", next.title, next.distance);
}

◆ is2DMode

- (BOOL) is2DMode

Returns true when top-down guidance is enabled.

◆ isActive

- (BOOL) isActive

Returns true when this controller may move the camera.

◆ mode

Current mode.

Swift code snippet:

print("Guidance mode: \‍(String(describing: guidanceCamera?.mode()))")

Objective C code snippet:

NSLog(@"Guidance mode: %ld", (long)[self.guidanceCamera mode]);

◆ removeListener:

- (void) removeListener: (nullable id< NCGuidanceListener >) listener

Removes a previously added listener.

◆ set2DMode:

- (void) set2DMode: (BOOL) enabled

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

Swift code snippet:

guidanceCamera?.set2DMode(false)

Objective C code snippet:

[self.guidanceCamera set2DMode:NO];

◆ setActive:

- (void) setActive: (BOOL) active

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

◆ setMode:

- (void) setMode: (NCGuidanceCameraMode) mode

Sets Free / Following / Overview.

Swift code snippet:

guidanceCamera?.setMode(.FOLLOWING)

Objective C code snippet:

[self.guidanceCamera setMode:NCGuidanceCameraModeFOLLOWING];

Property Documentation

◆ valid

- (BOOL) valid
readnonatomicassign

Tells if this object is valid or not. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now.

Definition at line 131 of file NCGuidanceCamera.h.


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