DefaultMyLocationViewModel

class DefaultMyLocationViewModel(map: Map, onPermissionRequest: () -> Unit = {}) : MyLocationViewModel

Default implementation of MyLocationViewModel.

Integrates with MyLocationControlModel to manage follow mode and delegates permission-related logic to the onPermissionRequest callback.

Parameters

map

The map instance used for location control.

onPermissionRequest

Callback invoked when the user taps the button and location permission is required (quality is LocationQuality.DEGRADED).

Constructors

Link copied to clipboard
constructor(map: Map, onPermissionRequest: () -> Unit = {})

Properties

Link copied to clipboard
open override val followState: StateFlow<CameraFollowState>

Observable state of the current camera follow mode.

Link copied to clipboard
open override val isEnabled: StateFlow<Boolean>

Observable state indicating whether the My Location control is enabled. When false, the button should appear disabled (e.g., when location source is unavailable).

Link copied to clipboard
open override val isPermissionRequired: <Error class: unknown class>

Observable state indicating whether location permission is required.

Functions

Link copied to clipboard
open override fun onCleared()

Releases resources when the view model is no longer needed.

Link copied to clipboard
open override fun onClicked()

Called when the user clicks the My Location button.