The viz_north function adds a north arrow a geoviz map.
Usage
viz_north(
map,
id = NULL,
pos = NULL,
scale = 1,
rotate = NULL,
fill = "black",
fillOpacity = 1,
...
)Arguments
- map
A
geovizmap created withviz_create.- id
character. Optional. Unique layer id.
- pos
numeric vector of length 2. Optional. Position [x, y] on the page (default c(svg.width - 30, 30)).
- scale
numeric. Optional. Scaling factor for the arrow (default 1).
- rotate
numeric. Optional. Rotation angle. If NA, it is automatically calculated.
- fill
character. Optional. Fill color (default "black").
- fillOpacity
numeric. Optional. Fill opacity (default 1).
- ...
Additional SVG attributes applied to the arrow.
Examples
library(sf)
world <- st_read(
system.file("gpkg/world.gpkg", package = "geoviz"),
quiet = TRUE
)
viz_create(projection = "Mercator", background = "white") |>
viz_path(datum = world[world$region == "Africa", ], fill = "#f1f3f5") |>
viz_north(fill = "#38896F") |>
viz_render()