Skip to content

geolocate_control

Stable

A button that centres the map on the user's location, with optional tracking.

The events this component sends to the LiveView, as the library documents them. Each arrives in handle_event/3. Use the preview; the last payload of each event the example receives appears here. A component sends only the events its events attribute names, so the example receives those its LiveView handles.

  • geolocate:location_found

    Fired when user's location is found, with coords (see the module documentation); for every position, also while tracking

    Not received yet.

  • geolocate:location_error

    Fired when there's an error getting location, with code and message

    Not received yet.

  • geolocate:tracking_started

    Fired when location tracking starts: the camera follows the user's location

    Not received yet.

  • geolocate:tracking_stopped

    Fired when location tracking stops, or the camera stops following the user's location because the user moved the map

    Not received yet.

  • geolocate:user_location_updated

    Fired for every position while the control tracks the user's location (track_user_location), also while the camera no longer follows it, with the same coords as geolocate:location_found

    Not received yet.