Skip to content

map

Stable

A MapLibre GL JS map whose center, zoom, pitch, bearing and style follow the LiveView's assigns.

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.

  • map:moved

    Fired when the map is moved (pan, zoom, rotate, pitch)

    Not received yet.

  • map:clicked

    Fired when the map is clicked

    Not received yet.

  • map:loaded

    Fired when the map finishes loading

    Not received yet.

  • map:zoom_changed

    Fired when zoom level changes

    Not received yet.

  • map:error

    Fired when MapLibre reports an error, such as a style, a source or a tile that could not be loaded. Besides the message, its params name the source, the HTTP status, the URL and the tile when MapLibre gives them. See "Errors" in the module documentation

    Not received yet.

  • map:follow_ended

    Fired when following the marker or the feature follow names ends while follow still names it: the user took the map ("reason" => "user"), or a camera command moved its centre ("reason" => "command"). Its params name the marker ("markerId"), or the layer and the feature ("layerId" and "featureId"). See "Following a marker" and "Following a feature of a layer" in the module documentation

    Not received yet.