MMKUserLocationLayer
@interface MMKUserLocationLayer : NSObject |
Use the UserLocationLayer interface to manage the location icon: its appearance, following mode, data source and so on.
Summary
Instance methods
- (void)setVisibleWithOn:(BOOL)on; |
- (BOOL)isVisible; |
- (void)setAnchorWithAnchorNormal:(CGPoint)anchorNormal |
- (void)resetAnchor; |
- (nullable MMKCameraPosition *)cameraPosition; |
- (void)setSourceWithSource:(nullable MMKLocationViewSource *)source; |
- (void)setDefaultSource; |
- (void)setTapListenerWithTapListener: |
- (void)setObjectListenerWithObjectListener: |
Properties
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, readonly, getter=isAnchorEnabled) BOOL anchorEnabled; |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, readonly, getter=isValid) BOOL valid; |
Instance methods
setVisibleWithOn:
- (void)setVisibleWithOn:(BOOL)on; |
Sets user location visibility.
isVisible
- (BOOL)isVisible; |
Checks if user location is visible.
setAnchorWithAnchorNormal:anchorCourse:
- (void)setAnchorWithAnchorNormal:(CGPoint)anchorNormal |
Sets the anchor to the specified position in pixels and enables Anchor mode. (0, 0) denotes the top-left corner of the screen.
Parameters |
|
anchorNormal |
The anchor position when the app is not on a steady course; usually, the center of the screen. |
anchorCourse |
An anchor position near the bottom line for steady course mode. |
resetAnchor
- (void)resetAnchor; |
Resets anchor mode.
cameraPosition
- (nullable MMKCameraPosition *)cameraPosition; |
Calculates the camera position that projects the current location into view. If the current location is unknown, returns none. If the current location is known, returns the camera position that displays the location position.
setSourceWithSource:
- (void)setSourceWithSource:(nullable MMKLocationViewSource *)source; |
Sets/gets the data source.
setDefaultSource
- (void)setDefaultSource; |
Sets the data source with the global location manager
setTapListenerWithTapListener:
- (void)setTapListenerWithTapListener: |
Sets/resets the tap listener.
The class does not retain the object in the 'tapListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
setObjectListenerWithObjectListener:
- (void)setObjectListenerWithObjectListener: |
Sets/resets the object listener.
The class does not retain the object in the 'objectListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
Properties
headingEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enables/disables heading mode. If heading mode is enabled, the map is rotated. If heading mode is disabled, the location icon is rotated.
anchorEnabled
@property (nonatomic, readonly, getter=isAnchorEnabled) BOOL anchorEnabled; |
Returns true if anchor mode is set, and false otherwise.
autoZoomEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enables/disables auto zoom.
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.