MMKCamera
class MMKCamera : NSObject |
Camera tracks location, user input and provide new CameraPosition for map.
Summary
Instance methods
func addListener(with cameraListener: MMKCameraListener) |
func removeListener(with cameraListener: MMKCameraListener) |
func setAutoZoomWithEnabled( enabled: Bool, animation: MMKAnimation_?) |
func setAutoRotationWithEnabled( enabled: Bool, animation: MMKAnimation_?) |
func setFollowingModeZoomOffsetWithOffset(_ offset: Float, |
func setOverviewRectWith( rect: MMKScreenRect?, animation: MMKAnimation_?) |
func setExtraOverviewPointsWith( points: [MMKPoint_]?) |
func cameraMode() -> MMKCameraMode |
func setCameraModeWith( mode: MMKCameraMode, animation: MMKAnimation_?) |
Properties
var isSwitchModesAutomatically: Bool { get set } |
var isValid: Bool { get } |
Instance methods
addListener(with:)
func addListener(with cameraListener: MMKCameraListener) |
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: MMKCameraListener) |
Undocumented
setAutoZoomWithEnabled(_:animation:)
func setAutoZoomWithEnabled( enabled: Bool, animation: MMKAnimation_?) |
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: MMKAnimation_?) |
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, |
Add offset
value to zoom in following mode. 0.0 by default.
setOverviewRectWith(_:animation:)
func setOverviewRectWith( rect: MMKScreenRect?, animation: MMKAnimation_?) |
Defines area, where all routes should be shown in 'Overview' mode. If overviewRect
is null, mapWindow.focusRect used.
setExtraOverviewPointsWith(_:)
func setExtraOverviewPointsWith( points: [MMKPoint_]?) |
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() -> MMKCameraMode |
Undocumented
setCameraModeWith(_:animation:)
func setCameraModeWith( mode: MMKCameraMode, animation: MMKAnimation_?) |
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.