set_source function

Set source of a map layer

Set source of a map layer

set_source(map, layer, source)

Arguments

  • map: A map object created by the mapboxgl or maplibre function, or a proxy object.
  • layer: The ID of the layer to update.
  • source: An sf object (which will be converted to a GeoJSON source).

Returns

The updated map object.

  • Maintainer: Kyle Walker
  • License: MIT + file LICENSE
  • Last published: 2025-03-18