Interface UserLocationLayer

Package world.mappable.mapkit.user_location

interface UserLocationLayer

Use the UserLocationLayer interface to manage the location icon: its appearance, following mode, data source and so on.

Summary

Methods

Type and modifiers

Method and Description

void

setVisible(boolean on)
Sets user location visibility.

boolean

isVisible()
Checks if user location is visible.

boolean

isHeadingModeActive()
Enables/disables heading mode.

void

setHeadingModeActive(boolean headingModeActive)

void

setAnchor(@NonNull android.graphics.PointF anchorNormal,
          @NonNull android.graphics.PointF anchorCourse)

Sets the anchor to the specified position in pixels and enables Anchor mode.

void

resetAnchor()
Resets anchor mode.

boolean

isAnchorEnabled()
Returns true if anchor mode is set, and false otherwise.

boolean

isAutoZoomEnabled()
Enables/disables auto zoom.

void

setAutoZoomEnabled(boolean autoZoomEnabled)

CameraPosition

cameraPosition()
Calculates the camera position that projects the current location into view.

void

setSource(@Nullable LocationViewSource source)
Sets/gets the data source.

void

setDefaultSource()
Sets the data source with the global location manager

void

setTapListener(@Nullable UserLocationTapListener tapListener)
Sets/resets the tap listener.

void

setObjectListener(@Nullable UserLocationObjectListener objectListener)
Sets/resets the object listener.

boolean

isValid()
Tells if this UserLocationLayer is valid or not.

Methods

setVisible

void setVisible(boolean on)

Sets user location visibility.


isVisible

boolean isVisible()

Checks if user location is visible.


isHeadingModeActive

boolean isHeadingModeActive()

Enables/disables heading mode.

If heading mode is enabled, the map is rotated. If heading mode is disabled, the location icon is rotated.


setHeadingModeActive

void setHeadingModeActive(boolean headingModeActive)


setAnchor

void setAnchor(@NonNull android.graphics.PointF anchorNormal,
               @NonNull android.graphics.PointF anchorCourse)

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.


isAnchorEnabled

boolean isAnchorEnabled()

Returns true if anchor mode is set, and false otherwise.


isAutoZoomEnabled

boolean isAutoZoomEnabled()

Enables/disables auto zoom.


setAutoZoomEnabled

void setAutoZoomEnabled(boolean autoZoomEnabled)


cameraPosition

@Nullable
CameraPosition 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.


setSource

void setSource(@Nullable LocationViewSource source)

Sets/gets the data source.


setDefaultSource

void setDefaultSource()

Sets the data source with the global location manager


setTapListener

void setTapListener(@Nullable UserLocationTapListener tapListener)

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.


setObjectListener

void setObjectListener(@Nullable UserLocationObjectListener objectListener)

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.


isValid

boolean isValid()

Tells if this UserLocationLayer is valid or not.

Any other method (except for this one) called on an invalid UserLocationLayer will throw java.lang.RuntimeException. An instance 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.