Add an image source to a Mapbox GL or Maplibre GL map
Arguments
- map
A map object created by the
mapboxglormaplibrefunction.- id
A unique ID for the source.
- url
A URL pointing to the image source.
- data
A
SpatRasterobject from theterrapackage or aRasterLayerobject.- coordinates
A list of coordinates specifying the image corners in clockwise order: top left, top right, bottom right, bottom left. For
SpatRasterorRasterLayerobjects, this will be extracted for you.- colors
A vector of colors to use for the raster image.
