Make an interactive map with basemap

oh_map_cog(
  cog_file,
  cog_dir = "https://storage.googleapis.com/offhab_lyrs",
  cog_range = c(1, 100),
  cog_method = "average",
  cog_palette = "spectral_r",
  lgnd_palette = "Spectral",
  lgnd_palette_r = TRUE,
  bb = c(-129.4, 23.2, -64.7, 48.9),
  title = "% Habitat",
  cog_opacity = 0.9,
  base_opacity = 0.5
)

Arguments

cog_file

filename of Cloud-Optimized GeoTIFF (COG)

cog_dir

directory of path to COG; defaults to "https://storage.googleapis.com/offhab_lyrs"

cog_range

range of values to colorramp in COG; default: c(1, 100)

cog_method

method for interpolation between zoom levels; choose "nearest" for categorical; default: "average" (for continuous)

cog_palette

color ramp that applies to the colormap_name of https://api.cogeo.xyz/cog/tiles; default: "spectral_r"

lgnd_palette

color ramp that applies to both leaflet::colorNumeric() default: "Spectral"

lgnd_palette_r

boolean whether lgnd_palette is reversed in leaflet::colorNumeric() color ramp default: True

bb

bounding box to feed leaflet::fitBounds() defaults to US48: c(-129.4, 23.2, -64.7, 48.9)

title

title for legend; default: "% Habitat"

cog_opacity

the opacity of the COG tile layer; default is 0.9

base_opacity

the opacity of the basemap; default is 0.5

Value

a leaflet::leaflet() map

Examples

# map by aphia_id
oh_map_cog("aphia_100599_web.tif")