Add a continuous legend
add_continuous_legend(
map,
legend_title,
values,
colors,
position = "top-left",
unique_id = NULL
)
The updated map object with the legend added.
A map object created by the mapboxgl
function.
The title of the legend.
The values being represented on the map (vector of stops).
The colors used to generate the color ramp.
The position of the legend on the map (one of "top-left", "bottom-left", "top-right", "bottom-right").
A unique ID for the legend container. Defaults to NULL.