addExtent: Add extent/bbox of spatial objects to a leaflet map

View source: R/extent.R

addExtentR Documentation

Add extent/bbox of spatial objects to a leaflet map

Description

This function adds the bounding box of a spatial object to a leaflet or mapview map.

Usage

addExtent(map, data, ...)

Arguments

map

A leaflet or mapview map.

data

A sf object to be added to the map.

...

additional arguments passed on to addFeatures

Examples

library(leaflet)

# Usage in leaflet
leaflet() %>%
  addProviderTiles("OpenStreetMap") %>%
  addExtent(gadmCHE)

leaflet(gadmCHE) %>%
  addProviderTiles("OpenStreetMap") %>%
  addExtent()

r-spatial/leafem documentation built on Nov. 1, 2024, 2:48 p.m.