Creates a new user location marker.
The position of the marker, or a position provider. Pass null
to create a marker with no position that you can update later.
The fill color of the marker.
The current position provider that the user location marker is subscribed to, or null
if one isn't set.
Setting the position provider will immediately update the current position. If the position provider is set to null
, the marker's position will also be cleared. Use clearPositionProvider to clear the position provider without clearing the current position.
Subscribes to position updates.
A function to unsubscribe from the position updates.
The callback function is not called until the position provider produces a new position: use currentPosition to get the current position.
A user location marker that can be displayed on the map.
Remarks
The user location marker can be configured with either a static position or a position provider (such as GeolocationPositionProvider) for automatic location updates. The marker itself implements the PositionProvider interface, allowing it to be used as a reactive location source for features like ReactiveRoute.
When configured with a position provider, the marker will automatically update its position and notify subscribers when the underlying position changes. When configured with a static position, the position can be updated manually by setting the position property.