Class YMKMapWindow
Handles the MapWindow element.
Instance Methods
- addSizeChangedListenerWithSizeChangedListener: | Add a SizeChangedListener. |
- onMemoryWarning | Called on memory warning. |
- removeSizeChangedListenerWithSizeChangedListener: | Remove a SizeChangedListener. |
- screenToWorldWithScreenPoint: | Transforms coordinates from screen space to world space. |
- setMaxFpsWithFps: | Caps FPS. |
- worldToScreenWithWorldPoint: | Transforms the position from world coordinates to screen coordinates. |
- addSizeChangedListenerWithSizeChangedListener: | Add a SizeChangedListener. |
- onMemoryWarning | Called on memory warning. |
- removeSizeChangedListenerWithSizeChangedListener: | Remove a SizeChangedListener. |
- screenToWorldWithScreenPoint: | Transforms coordinates from screen space to world space. |
- setMaxFpsWithFps: | Caps FPS. |
- worldToScreenWithWorldPoint: | Transforms the position from world coordinates to screen coordinates. |
Properties
fieldOfViewY | Sets the vertical field of view, in degrees. |
focusRect | When using controls that overlay the map view, calculating the proper camera position can be tricky. |
focusRegion | |
map | |
pointOfView | Sets the position of the point of view. |
scaleFactor | Sets the scale factor, which equals the number of pixels per device-independent point. |
valid | Tells if this object is valid or no. |
zoomFocusPoint | Defines the focus point of map zooming for double tap and multi tap gestures. |
fieldOfViewY | Sets the vertical field of view, in degrees. |
focusRect | When using controls that overlay the map view, calculating the proper camera position can be tricky. |
focusRegion | |
map | |
pointOfView | Sets the position of the point of view. |
scaleFactor | Sets the scale factor, which equals the number of pixels per device-independent point. |
valid | Tells if this object is valid or no. |
zoomFocusPoint | Defines the focus point of map zooming for double tap and multi tap gestures. |
Method Detail
-addSizeChangedListenerWithSizeChangedListener:
- (void)addSizeChangedListenerWithSizeChangedListener:(nullable id< YMKMapSizeChangedListener >)sizeChangedListener
Add a SizeChangedListener.
-onMemoryWarning
- (void)onMemoryWarning
Called on memory warning.
-removeSizeChangedListenerWithSizeChangedListener:
- (void)removeSizeChangedListenerWithSizeChangedListener:(nullable id< YMKMapSizeChangedListener >)sizeChangedListener
Remove a SizeChangedListener.
-screenToWorldWithScreenPoint:
- (nullable YMKPoint *)screenToWorldWithScreenPoint:(nonnull YMKScreenPoint *)screenPoint
Transforms coordinates from screen space to world space.
screenPoint | The point in screen coordinates relative to the top left of the map. These coordinates are in physical pixels and not in device independent (virtual) pixels. |
screenPoint | The point in screen coordinates relative to the top left of the map. These coordinates are in physical pixels and not in device independent (virtual) pixels. |
Returns:
Latitude and longitude information.
-setMaxFpsWithFps:
- (void)setMaxFpsWithFps:(float)fps
Caps FPS.
Valid range: (0, 60]. Default: 60.-worldToScreenWithWorldPoint:
- (nullable YMKScreenPoint *)worldToScreenWithWorldPoint:(nonnull YMKPoint *)worldPoint
Transforms the position from world coordinates to screen coordinates.
worldPoint | Latitude and longitude information. |
worldPoint | Latitude and longitude information. |
Returns:
The point in screen space corresponding to worldPoint; returns none if the point is behind the camera.
Property Detail
fieldOfViewY
(assign, readwrite) double fieldOfViewY
Sets the vertical field of view, in degrees.
Default: 30.
focusRect
(assign, readwrite) YMKScreenRect * focusRect
When using controls that overlay the map view, calculating the proper camera position can be tricky.
This method simplifies the task by defining the area of interest (the focus rectangle) inside the view. This area serves as a reference for all subsequent camera movements.
For example, when using a semi-transparent control that overlays the top half of the map view, define the focus rectangle as the lower half of the view to ensure that all camera movements will have the center of the lower half as their target.
On iOS, if you change the focus rectangle in the viewDidLayoutSubviews callback, it's recommended to call MapView.layoutIfNeeded just before that action.
Optional property, can be nil.
focusRegion
(assign, readonly) YMKVisibleRegion * focusRegion
Returns:
A region that corresponds to the current focusRect or the visible region if focusRect is not set. Region IS bounded by latitude limits [-90, 90] and IS NOT bounded by longitude limits [-180, 180]. If longitude exceeds its limits, we see the world's edge and another instance of the world beyond this edge.
map
(assign, readonly) YMKMap * map
pointOfView
(assign, readwrite) YMKPointOfView pointOfView
Sets the position of the point of view.
Cameras use perspective projection, which causes perspective deformations. Perspective projection has an axis, and points on this axis are not affected by perspective deformations. This axis is a line parallel to the view's direction, so its projection to the screen is a point - the "point of view". By default, this point is at the center of the screen, but some applications might want to set it to the center of focusRect. Use this flag to do so. Default: ScreenCenter
scaleFactor
(assign, readwrite) float scaleFactor
Sets the scale factor, which equals the number of pixels per device-independent point.
valid
(assign, 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.
zoomFocusPoint
(assign, readwrite) YMKScreenPoint * zoomFocusPoint
Defines the focus point of map zooming for double tap and multi tap gestures.
If the point is not set, the source point of the gesture will be used as the focus point. Default: none.
Optional property, can be nil.