Skip to contents

Plots a spatial map of coral populations over a setplot base layer using tmap. Species are color-coded with a customizable palette, and output can be either interactive (web) or static. Optionally enables or disables WebGL for 3D rendering in interactive view.

Usage

map_populations(
  setplot,
  populations,
  interactive = TRUE,
  zoom = c(22, 32),
  webgl = TRUE
)

Arguments

setplot

An sf or SpatVector object representing the background plot layer (e.g. reef tiles).

populations

An sf object with point geometries and a species column to map.

interactive

Logical; if TRUE, the map is shown in an interactive web view. If FALSE, it renders as a static plot.

webgl

Logical; if interactive = TRUE, sets WebGL rendering mode in tm_view().

Value

A tmap object

Examples

if (FALSE) { # \dontrun{
grid <- setplot(10, 5)
map_populations(setplot = grid, populations = coral_points, interactive = TRUE, webgl = FALSE)
} # }