Skip to contents

The object is transformed to EPSG:4326 before serialization.

Usage

add_sf(
  map,
  data,
  name = deparse(substitute(data)),
  style = list(),
  visible = TRUE,
  opacity = 1
)

Arguments

map

A GeoLibre widget.

data

An sf or sfc object.

name

Layer name.

style

Named list of GeoLibre style overrides such as fillColor, strokeColor, and strokeWidth.

visible

Whether the layer is initially visible.

opacity

Layer opacity from zero to one.

Value

The modified widget.

Examples

if (requireNamespace("sf", quietly = TRUE)) {
  point <- sf::st_sf(
    name = "Washington, DC",
    geometry = sf::st_sfc(sf::st_point(c(-77.0369, 38.9072)), crs = 4326)
  )
  map <- geolibre() |> add_sf(point, name = "Places")
}