YMKCamera

class YMKCamera : NSObject

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

Summary

Instance methods

func addListener(with cameraListener: YMKCameraListener)
The class does not retain the object in the 'cameraListener' parameter

func removeListener(with cameraListener: YMKCameraListener)
Undocumented

func setAutoZoomWithEnabled( enabled: Bool, animation: YMKAnimation_?)
Set autozoom in 'Following' camera mode

func setAutoRotationWithEnabled( enabled: Bool, animation: YMKAnimation_?)
Set autorotation in 'Following' camera mode

func setFollowingModeZoomOffsetWithOffset(_ offset: Float,
                                         animation: YMKAnimation?)
Add offset value to zoom in following mode

func setOverviewRectWith( rect: YMKScreenRect?, animation: YMKAnimation_?)
Defines area, where all routes should be shown in 'Overview' mode

func setExtraOverviewPointsWith( points: [YMKPoint_]?)
Given points will be visible when camera switches to 'Overview' mode

func cameraMode() -> YMKCameraMode
Undocumented

func setCameraModeWith( mode: YMKCameraMode, animation: YMKAnimation_?)
Undocumented

Properties

var isSwitchModesAutomatically: Bool { get set }
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

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

addListener(with:)

func addListener(with cameraListener: YMKCameraListener)

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.


removeListener(with:)

func removeListener(with cameraListener: YMKCameraListener)

Undocumented


setAutoZoomWithEnabled(_:animation:)

func setAutoZoomWithEnabled( enabled: Bool, animation: YMKAnimation_?)

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


setAutoRotationWithEnabled(_:animation:)

func setAutoRotationWithEnabled( enabled: Bool, animation: YMKAnimation_?)

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


setFollowingModeZoomOffsetWithOffset(_:animation:)

func setFollowingModeZoomOffsetWithOffset(_ offset: Float,
                                         animation: YMKAnimation?)

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


setOverviewRectWith(_:animation:)

func setOverviewRectWith( rect: YMKScreenRect?, animation: YMKAnimation_?)

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


setExtraOverviewPointsWith(_:)

func setExtraOverviewPointsWith( points: [YMKPoint_]?)

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()

func cameraMode() -> YMKCameraMode

Undocumented


setCameraModeWith(_:animation:)

func setCameraModeWith( mode: YMKCameraMode, animation: YMKAnimation_?)

Undocumented


Properties

isSwitchModesAutomatically

var isSwitchModesAutomatically: Bool { get set }

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.


isValid

var isValid: Bool { get }

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.


Предыдущая
Следующая