Skip to contents

Create a layer

Usage

Layer(type, id, source = NULL, paint = NULL, layout = NULL, ...)

Arguments

layout

Examples

library(maplibre)

earthquakes_source <- list(
  type = "geojson",
  data = "https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson"
)

earthquakes_layer <- Layer(
  id = "earthquakes",
  type = "circle",
  source = earthquakes_source,
  paint = list("circle-color" = "yellow", "circle-radius" = 2)
)

maplibre() |>
  add_layer(earthquakes_layer)