Skip to contents

Shows the map's scale, and rescales itself as the reader zooms.

Usage

add_scale_bar(map, position = NULL, unit = NULL, bar_style = NULL, ...)

Arguments

map

Defines which map or arc_map_proxy() to modify.

position

default NULL. Defines which corner it sits in, one of "top-left", "top-right", "bottom-left", "bottom-right", or the direction-aware "top-start", "top-end", "bottom-start", "bottom-end". Each widget has its own default.

unit

default NULL. Defines the units shown, one of "metric", "imperial", or "dual".

bar_style

default NULL. Defines how it is drawn, "line" or "ruler".

...

Named properties of the component itself, written either snake_case or camelCase. map_widgets() lists what each one takes.

Value

map, with the widget added.

Examples

arc_map() |> add_scale_bar(unit = "dual")