add_source: Add a GeoJSON or sf source to a Mapbox GL or Maplibre GL map

View source: R/sources.R

add_sourceR Documentation

Add a GeoJSON or sf source to a Mapbox GL or Maplibre GL map

Description

Add a GeoJSON or sf source to a Mapbox GL or Maplibre GL map

Usage

add_source(map, id, data, ...)

Arguments

map

A map object created by the mapboxgl or maplibre function.

id

A unique ID for the source.

data

An sf object or a URL pointing to a remote GeoJSON file.

...

Additional arguments to be passed to the JavaScript addSource method.

Value

The modified map object with the new source added.


mapgl documentation built on Nov. 1, 2024, 5:08 p.m.