Skip to content

trail

Stable

Draws where a moving marker, or each moving point of a GeoJSON layer, has just been, as a line kept in the browser.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — Unique identifier: the layer's id, and, with -source after it, its source's
map_id required string — ID of the map to draw the trail on
marker string nil the id of the <.marker> to follow
layer string nil the id of the <.geojson_layer> whose points to follow, instead of a marker
max_points integer 100 the most positions kept, the marker's own included
max_age any nil how many seconds of the path to show; nil for no limit
max_distance any nil the longest step, in metres on the ground: a longer one breaks the line; nil for none
paint map %{} Paint properties of the line layer ("line-color", "line-width", "line-opacity", "line-gradient", ...)
layout map %{} Layout properties of the line layer ("line-cap", "line-join", "visibility", ...)
filter any nil Filter expression on the trails, whose ids (["id"]) are those of what they follow
min_zoom integer nil Minimum zoom level to show the trail
max_zoom integer nil Maximum zoom level to show the trail
before_id string nil ID of the layer to put the trail under