Navmii SDK  2.2.0
Write yourself a navigation system in iOS
Instance Methods | Class Methods | Properties | List of all members
NMCameraController Class Reference

Inherits <NSObject>.

Instance Methods

(void) - setCameraPosition:
 
(void) - animateCameraToPosition:
 
(void) - animateCameraToPosition:completion:
 
(void) - animateCameraToPosition:duration:completion:
 
(void) - setCameraTargetLocation:
 
(void) - setCameraZoom:
 
(void) - setCameraPitch:
 
(void) - setCameraHeading:
 
(void) - animateCameraTargetLocation:duration:completion:
 
(void) - animateCameraZoom:duration:completion:
 
(void) - animateCameraPitch:duration:completion:
 
(void) - animateCameraHeading:duration:completion:
 
(void) - stopAnimation
 
(void) - addCameraMovementListener:
 
(void) - removeCameraMovementListener:
 
(NMCameraPosition *) - cameraPositionForMapRectangle:withInsets:heading:pitch:
 
(nullable instancetype) - NS_UNAVAILABLE
 

Class Methods

(nullable instancetype) + NS_UNAVAILABLE
 

Properties

NMCameraPositioncameraPosition
 

Detailed Description

NMCameraController provides the ability to manage map rotation, tilt and zoom via changing the camera position (heading, pitch and zoom) instantly or animated. It also allows to listen to the camera position changes which can be invoked 1) by the user interaction with the map (gestures), 2) by animating or moving the camera using methods of NMCameraController or 3) by the SDK itself (for example, when option to follow the GPS postion is set in NMMapView).

Method Documentation

◆ addCameraMovementListener:()

- (void) addCameraMovementListener: (addCameraMovementListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMCameraMovementListener. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMCameraMovementListener protocol to be added to listeners.

◆ animateCameraHeading:duration:completion:()

- (void) animateCameraHeading: (CGFloat)  heading
duration: (CGFloat)  duration
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished.

Parameters
headingNew camera heading value.
durationThe total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ animateCameraPitch:duration:completion:()

- (void) animateCameraPitch: (CGFloat)  pitch
duration: (CGFloat)  duration
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished.

Parameters
pitchNew camera pitch value.
durationThe total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ animateCameraTargetLocation:duration:completion:()

- (void) animateCameraTargetLocation: (NMMapCoordinates *)  targetLocation
duration: (CGFloat)  duration
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished.

Parameters
targetLocationCoordinates of the new location which the camera should point to.
durationThe total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ animateCameraToPosition:()

- (void) animateCameraToPosition: (NMCameraPosition *)  cameraPosition

Changes the camera position with animation. Default animation duration is 0.5 seconds.

Parameters
cameraPositionThe new position of the camera.

◆ animateCameraToPosition:completion:()

- (void) animateCameraToPosition: (NMCameraPosition *)  cameraPosition
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished. Default animation duration is 0.5 seconds.

Parameters
cameraPositionThe new position of the camera.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ animateCameraToPosition:duration:completion:()

- (void) animateCameraToPosition: (NMCameraPosition *)  cameraPosition
duration: (CGFloat)  duration
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished.

Parameters
cameraPositionThe new position of the camera.
durationThe total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ animateCameraZoom:duration:completion:()

- (void) animateCameraZoom: (CGFloat)  zoom
duration: (CGFloat)  duration
completion: (_Nullable NMAnimationCompletion completion 

Changes the camera position with animation and performs the completion block when the animation is finished.

Parameters
zoomNew camera zoom level.
durationThe total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation.
completionThe completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information.

◆ cameraPositionForMapRectangle:withInsets:heading:pitch:()

- (NMCameraPosition *) cameraPositionForMapRectangle: (NMMapRectangle *)  mapRectangle
withInsets: (UIEdgeInsets)  insets
heading: (CGFloat)  heading
pitch: (CGFloat)  pitch 

Use this method to obtain the camera position needed to fit the specified geographical area in map view bounds.

Returns
NMCameraPosition needed to fit the specified mapRectangle in view bounds.
Parameters
mapRectangleThe NMMapRectangle to fit the screen.
insetsInsets to apply to map view bounds.
headingThe required heading of the camera.
pitchThe required pitch of the camera.

◆ NS_UNAVAILABLE() [1/2]

+ (nullable instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE() [2/2]

- (nullable instancetype) NS_UNAVAILABLE

◆ removeCameraMovementListener:()

- (void) removeCameraMovementListener: (removeCameraMovementListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMCameraMovementListener.

Parameters
listenerAn object conforming to NMCameraMovementListener protocol to be removed from listeners.

◆ setCameraHeading:()

- (void) setCameraHeading: (CGFloat)  heading

Changes the camera heading to the specified value instantly, without animation.

Parameters
headingNew camera heading value.

◆ setCameraPitch:()

- (void) setCameraPitch: (CGFloat)  pitch

Changes the camera's pitch to the specified value instantly, without animation.

Parameters
pitchNew camera pitch value.

◆ setCameraPosition:()

- (void) setCameraPosition: (NMCameraPosition *)  cameraPosition

Changes the camera position instantly, without animation.

Parameters
cameraPositionThe new position of the camera.

◆ setCameraTargetLocation:()

- (void) setCameraTargetLocation: (NMMapCoordinates *)  targetLocation

Moves the camera to the specified location instantly, without animation.

Parameters
targetLocationCoordinates of the new location which the camera should point to.

◆ setCameraZoom:()

- (void) setCameraZoom: (CGFloat)  zoom

Changes the camera's zoom to the specified value instantly, without animation.

Parameters
zoomNew camera zoom level.

◆ stopAnimation()

- (void) stopAnimation

Stops animation which is currently in progress. Completion blocks of all the aborted animations will be called with parameter "canceled" set to YES.

Property Documentation

◆ cameraPosition

- (NMCameraPosition*) cameraPosition
readnonatomicstrong

Current camera position. Refer to the NMCameraPosition for more information.