GeolocateControl
API Reference (beta) for <GeolocateControl />
Property | Type | Description |
---|---|---|
position optional | "top-left" | "top-right" | "bottom-left" | "bottom-right" | - |
ontrackuserlocationend optional | Listener<GeolocateEvent>() | - |
ontrackuserlocationstart optional | Listener<GeolocateEvent>() | - |
onuserlocationlostfocus optional | Listener<GeolocateEvent>() | - |
onuserlocationfocus optional | Listener<GeolocateEvent>() | - |
ongeolocate optional | Listener<Event<GeolocateControl> | object | GeolocationPosition>() | - |
onerror optional | Listener<Event<GeolocateControl> | object | GeolocationPositionError>() | - |
onoutofmaxbounds optional | Listener<Event<GeolocateControl> | object | GeolocationPosition>() | - |
positionOptions optional | { enableHighAccuracy?: boolean, maximumAge?: number, timeout?: number } | A Geolocation API [PositionOptions](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions) object. |
fitBoundsOptions optional | FitBoundsOptions | A options object to use when the map is panned and zoomed to the user's location. The default is to use a `maxZoom` of 15 to limit how far the map will zoom in for very accurate locations. |
trackUserLocation optional | boolean | If `true` the `GeolocateControl` becomes a toggle button and when active the map will receive updates to the user's location as it changes. |
showAccuracyCircle optional | boolean | By default, if `showUserLocation` is `true`, a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to `false` to disable. Always disabled when `showUserLocation` is `false`. |
showUserLocation optional | boolean | By default a dot will be shown on the map at the user's location. Set to `false` to disable. |