add_continuous_legend | R Documentation |
Add a continuous legend
add_continuous_legend(
map,
legend_title,
values,
colors,
position = "top-left",
unique_id = NULL,
add = FALSE,
width = NULL
)
map |
A map object created by the |
legend_title |
The title of the legend. |
values |
The values being represented on the map (vector of stops). |
colors |
The colors used to generate the color ramp. |
position |
The position of the legend on the map (one of "top-left", "bottom-left", "top-right", "bottom-right"). |
unique_id |
A unique ID for the legend container. Defaults to NULL. |
add |
Logical, whether to add this legend to existing legends (TRUE) or replace existing legends (FALSE). Default is FALSE. |
width |
The width of the legend. Can be specified in pixels (e.g., "250px") or as "auto". Default is NULL, which uses the built-in default. |
The updated map object with the legend added.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.