Skip to main content

UserLocationLayer

wemap-sdk-js


Class: UserLocationLayer

Displays the user's position on the map from a positioning stream.

Call update on each pose emission. Map level sync is automatic via WemapMap's internal level coordinator. When accuracyRing is enabled, a geographic circle of UserLocationUpdate.accuracy metres is drawn as a GeoJSON fill/line layer beneath the marker — so it stays ground-anchored at any zoom or tilt (HTML markers sized from screen metres-per-pixel do not).

WemapMap.remove() does not destroy this layer — call destroy explicitly.

Constructors​

Constructor​

new UserLocationLayer(wemapMap, options?): UserLocationLayer

Parameters​

wemapMap​

WemapMap

options?​

UserLocationLayerOptions = {}

Returns​

UserLocationLayer

Methods​

destroy()​

destroy(): void

Remove the marker (and its accuracy ring) and detach listeners.

Returns​

void


update()​

update(update): void

Apply a location update from a positioning source.

Updates that arrive before the map style has loaded are buffered and replayed in order once it is ready, so the first fix during map init is not dropped.

Parameters​

update​

UserLocationUpdate

Returns​

void