Skip to main content

Location indicator

Enabling user location indicator will render a view on the map that shows the device's current location.

Enable the default user location indicator using the following code:

mapView.locationManager.apply {
cameraMode = CameraMode.TRACKING_COMPASS
renderMode = RenderMode.COMPASS
}

Change view style

To customize the appearance of the location indicator use UserLocationViewStyles

mapView.locationManager.userLocationViewStyles = UserLocationViewStyles(
normal = UserLocationViewStateStyle(
foregroundColor = Color.GREEN,
backgroundColor = Color.WHITE,
bearingColor = Color.RED
),
stale = UserLocationViewStateStyle(
foregroundColor = Color.RED,
backgroundColor = Color.WHITE,
bearingColor = Color.CYAN
),
outOfActiveLevelAlpha = 0.4f,
accuracyColor = Color.GREEN,
accuracyAlpha = 0.2f,
pulseEnabled = true,
pulseColor = Color.MAGENTA,
pulseAlpha = 0.3f
)

Examples

For additional examples and sample implementations of WemapSDKs, visit the official GitHub repository.

Clone the repository and follow the README instructions to run the sample application.