MMKCamera

@interface MMKCamera : NSObject

Camera tracks location, user input and provide new CameraPosition for map.

Summary

Instance methods

- (void)addListenerWithCameraListener:
    (nonnull id<MMKCameraListener>)cameraListener;

The class does not retain the object in the 'cameraListener' parameter

- (void)removeListenerWithCameraListener:
    (nonnull id<MMKCameraListener>)cameraListener;

Undocumented

- (void)setAutoZoomWithEnabled:(BOOL)enabled
                     animation:(nullable MMKAnimation *)animation;

Set autozoom in 'Following' camera mode

- (void)setAutoRotationWithEnabled:(BOOL)enabled
                         animation:(nullable MMKAnimation *)animation;

Set autorotation in 'Following' camera mode

- (void)setFollowingModeZoomOffsetWithOffset:(float)offset
                                   animation:(nullable MMKAnimation *)animation;

Add offset value to zoom in following mode

- (void)setOverviewRectWithRect:(nullable MMKScreenRect *)rect
                      animation:(nullable MMKAnimation *)animation;

Defines area, where all routes should be shown in 'Overview' mode

- (void)setExtraOverviewPointsWithPoints:(nullable NSArray<MMKPoint *> *)points;
Given points will be visible when camera switches to 'Overview' mode

- (MMKCameraMode)cameraMode;
Undocumented

- (void)setCameraModeWithMode:(MMKCameraMode)mode
                    animation:(nullable MMKAnimation *)animation;

Undocumented

Properties

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isSwitchModesAutomatically) BOOL switchModesAutomatically;

If enabled, camera will automatically switch between modes: <ul><li>Camera will become into 'Following' mode if current route in navigation selected or current speed is greater than: 10 km/h for auto and 5 km/h for pedestrian navigations

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

addListenerWithCameraListener:

- (void)addListenerWithCameraListener:
    (nonnull id<MMKCameraListener>)cameraListener;

The class does not retain the object in the 'cameraListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.


removeListenerWithCameraListener:

- (void)removeListenerWithCameraListener:
    (nonnull id<MMKCameraListener>)cameraListener;

Undocumented


setAutoZoomWithEnabled:animation:

- (void)setAutoZoomWithEnabled:(BOOL)enabled
                     animation:(nullable MMKAnimation *)animation;

Set autozoom in 'Following' camera mode. animation parameter ignored if camera currently not in the 'Following' mode. Enabled by default.


setAutoRotationWithEnabled:animation:

- (void)setAutoRotationWithEnabled:(BOOL)enabled
                         animation:(nullable MMKAnimation *)animation;

Set autorotation in 'Following' camera mode. animation parameter ignored if camera currently not in the 'Following' mode. Enabled by default.


setFollowingModeZoomOffsetWithOffset:animation:

- (void)setFollowingModeZoomOffsetWithOffset:(float)offset
                                   animation:(nullable MMKAnimation *)animation;

Add offset value to zoom in following mode. 0.0 by default.


setOverviewRectWithRect:animation:

- (void)setOverviewRectWithRect:(nullable MMKScreenRect *)rect
                      animation:(nullable MMKAnimation *)animation;

Defines area, where all routes should be shown in 'Overview' mode. If overviewRect is null, mapWindow.focusRect used.


setExtraOverviewPointsWithPoints:

- (void)setExtraOverviewPointsWithPoints:(nullable NSArray<MMKPoint *> *)points;

Given points will be visible when camera switches to 'Overview' mode. It is useful when you draw some extra info on the map out of routes.


cameraMode

- (MMKCameraMode)cameraMode;

Undocumented


setCameraModeWithMode:animation:

- (void)setCameraModeWithMode:(MMKCameraMode)mode
                    animation:(nullable MMKAnimation *)animation;

Undocumented


Properties

switchModesAutomatically

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isSwitchModesAutomatically) BOOL switchModesAutomatically;

If enabled, camera will automatically switch between modes:

  • Camera will become into 'Following' mode if current route in navigation selected or current speed is greater than: 10 km/h for auto and 5 km/h for pedestrian navigations.
  • Camera will become into 'Following' mode from 'Overview' mode on guidance start.
  • Camera will become into 'Overview' when routes requested, but current route does not selected yet.
  • Camera will become into 'Free' mode from 'Following' mode on any external move (gesture / call map.move)
  • Camera will become into 'Following' mode from 'Free' mode if requirements from (1) satisfied and there are no any camera moving activity for 10 seconds

Enabled by default.


valid

@property (nonatomic, readonly, getter=isValid) BOOL valid;

Tells if this object is valid or no. 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. Please refer to general docs about the interface for details on its invalidation.