Supply the legend entries exactly one of three ways: a built-in preset
(builtin), a named vector or list of label-to-color pairs (legend), or
parallel labels and colors vectors. Each call adds another legend, so a
map can carry several at once.
Arguments
- map
A GeoLibre widget.
- title
Legend title. Defaults to
"Legend", or the preset's own title whenbuiltinis supplied without one.- legend
A named vector or list mapping label to CSS color. Order is preserved.
- labels
Item labels, paired position-wise with
colors.- colors
Item CSS colors, paired position-wise with
labels.- builtin
A built-in preset name from
builtin_legend_names().- position
Corner for the legend:
"top-left","top-right","bottom-left", or"bottom-right".- shape
Swatch shape for every item:
"square","circle", or"line".
See also
add_colorbar() for continuous rasters, builtin_legend_names()