Skip to contents

The viz_outline function draws the Earth outline according to the current map projection. This layer can be used as a background or clipping reference.

Usage

viz_outline(
  map,
  id = NULL,
  stroke = "none",
  strokeWidth = 1,
  fill = "#B5DFFD",
  ...
)

Arguments

map

A geoviz map created with viz_create.

id

character. Optional. Unique layer id.

stroke

character. Optional. Stroke color (default "none").

strokeWidth

numeric. Optional. Stroke width (default 1).

fill

character. Optional. Fill color (default "#B5DFFD").

...

Additional SVG attributes (e.g. strokeDasharray, opacity, strokeLinecap, etc.).

Examples

library(sf)
world <- st_read(
  system.file("gpkg/world.gpkg", package = "geoviz"),
  quiet = TRUE
)

viz_create(projection = "EqualEarth", background = "white") |>
viz_path(datum = world, fill = "#f1f3f5") |>
viz_outline(fill = "#38896F") |>
viz_render()