Navmii SDK
2.2.0
Write yourself a navigation system in iOS
|
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 | |
NMCameraPosition * | cameraPosition |
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).
- (void) addCameraMovementListener: | (addCameraMovementListener(listener:)) | NS_SWIFT_NAME |
Adds a listener responding to events described in NMCameraMovementListener. You can add multiple listeners using this method.
listener | An object conforming to NMCameraMovementListener protocol to be added to listeners. |
- (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.
heading | New camera heading value. |
duration | The total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (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.
pitch | New camera pitch value. |
duration | The total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (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.
targetLocation | Coordinates of the new location which the camera should point to. |
duration | The total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (void) animateCameraToPosition: | (NMCameraPosition *) | cameraPosition |
Changes the camera position with animation. Default animation duration is 0.5 seconds.
cameraPosition | The new position of the camera. |
- (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.
cameraPosition | The new position of the camera. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (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.
cameraPosition | The new position of the camera. |
duration | The total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (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.
zoom | New camera zoom level. |
duration | The total duration of the animation, measured in seconds. If you specify 0, the changes are made without animation. |
completion | The completion block to be executed when the animation ends. This parameter may be nil. Refer to the NMAnimationCompletion for more information. |
- (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.
mapRectangle | The NMMapRectangle to fit the screen. |
insets | Insets to apply to map view bounds. |
heading | The required heading of the camera. |
pitch | The required pitch of the camera. |
+ (nullable instancetype) NS_UNAVAILABLE |
- (nullable instancetype) NS_UNAVAILABLE |
- (void) removeCameraMovementListener: | (removeCameraMovementListener(listener:)) | NS_SWIFT_NAME |
Removes a listener responding to events described in NMCameraMovementListener.
listener | An object conforming to NMCameraMovementListener protocol to be removed from listeners. |
- (void) setCameraHeading: | (CGFloat) | heading |
Changes the camera heading to the specified value instantly, without animation.
heading | New camera heading value. |
- (void) setCameraPitch: | (CGFloat) | pitch |
Changes the camera's pitch to the specified value instantly, without animation.
pitch | New camera pitch value. |
- (void) setCameraPosition: | (NMCameraPosition *) | cameraPosition |
Changes the camera position instantly, without animation.
cameraPosition | The new position of the camera. |
- (void) setCameraTargetLocation: | (NMMapCoordinates *) | targetLocation |
Moves the camera to the specified location instantly, without animation.
targetLocation | Coordinates of the new location which the camera should point to. |
- (void) setCameraZoom: | (CGFloat) | zoom |
Changes the camera's zoom to the specified value instantly, without animation.
zoom | New camera zoom level. |
- (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.
|
readnonatomicstrong |
Current camera position. Refer to the NMCameraPosition for more information.