Skip to contents

Add MapLibre scale bar

Usage

add_scalebar(
  map,
  position = "bottomleft",
  unit = c("metric", "imperial", "nautical"),
  max_width = 100,
  ...
)

Arguments

map

A maplamina widget created by maplamina().

position

Control position: "topleft", "topright", "bottomleft", "bottomright".

unit

Units for the scale bar.

max_width

Maximum scale bar width (pixels).

...

Named options passed through to the underlying MapLibre control.

Value

The modified map widget.

Examples

maplamina() |>
  add_scalebar(unit = "metric")