Learn R Programming

mapgl (version 0.3)

add_vector_source: Add a vector tile source to a Mapbox GL or Maplibre GL map

Description

Add a vector tile source to a Mapbox GL or Maplibre GL map

Usage

add_vector_source(map, id, url, promote_id = NULL, ...)

Value

The modified map object with the new source added.

Arguments

map

A map object created by the mapboxgl or maplibre function.

id

A unique ID for the source.

url

A URL pointing to the vector tile source.

promote_id

An optional property name to use as the feature ID. This is required for hover effects on vector tiles.

...

Additional arguments to be passed to the JavaScript addSource method.