Loading...
Searching...
No Matches

Class is used to listen for camera updates. More...

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

Inherits <NSObject>.

Instance Methods

(void) - onCameraPositionChanged:finished:
 Triggered when the camera position changed.
 

Detailed Description

Class is used to listen for camera updates.

Referenced from LocationWindow.

Definition at line 20 of file NCCameraListener.h.

Method Documentation

◆ onCameraPositionChanged:finished:

- (void) onCameraPositionChanged: (NCCameraUpdateReason) reason
finished: (BOOL) finished 

Triggered when the camera position changed.

Parameters
reasonreason of camera update.
finishedtrue if the camera finished moving, false otherwise. If a movement is cancelled then reason represents initiator of cancellation.

Swift code snippet:

func onCameraPositionChanged(reason: NCCameraUpdateReason, finished: Bool) {
let reasonText = (reason == .gestures) ? "user gestures" : "application"
let statusText = finished ? "finished" : "in progress"
print("Camera position changed: \‍(reasonText), status: \‍(statusText)")
if finished {
print("Camera movement completed")
}
}

Objective C code snippet:

- (void)onCameraPositionChangedWithReason:(NCCameraUpdateReason)reason finished:(BOOL)finished {
NSString *reasonString = @"";
switch (reason) {
case NCCameraUpdateReasonUser:
reasonString = @"User";
break;
case NCCameraUpdateReasonAnimation:
reasonString = @"Animation";
break;
case NCCameraUpdateReasonProgrammatic:
reasonString = @"Programmatic";
break;
}
NSLog(@"Camera position changed - Reason: %@, Finished: %@", reasonString, finished ? @"Yes" : @"No");
}

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