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 geovizr map object created using 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.).

Value

A modified `geoviz` map object with a new layer added. Rendering is performed using viz_render().

Examples

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

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