Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

viewExtent

View extent/bbox of spatial objects interactively


Description

This function produces an interactive view of the extent/bbox of the supplied spatial object

Usage

viewExtent(
  x,
  map = NULL,
  popup = NULL,
  layer.name = NULL,
  alpha.regions = 0.2,
  label = NULL,
  ...
)

Arguments

x

either a Raster*, sf* or Spatial* object

map

a leaflet or mapview map the extent should be added to. If NULL standard background layers are created.

popup

a list of HTML strings with the popup contents, usually created from popupTable. See addControl for details.

layer.name

the name of the layer to be shown on the map.

alpha.regions

opacity of the fills or the raster layer(s).

label

a character vector of labels to be shown on mouseover. See addControl for details.

...

additional arguments passed on to addRectangles

Author(s)

Tim Appelhans

Examples

library(leaflet)

viewExtent(breweries)
viewExtent(franconia) + breweries
mapview(franconia) %>% leafem::addExtent(franconia, fillColor = "yellow")
leaflet() %>% addProviderTiles("OpenStreetMap") %>% leafem::addExtent(breweries)
leaflet() %>% addProviderTiles("OpenStreetMap") %>% leafem::addExtent(breweries)

mapview

Interactive Viewing of Spatial Data in R

v2.10.0
GPL (>= 3) | file LICENSE
Authors
Tim Appelhans [cre, aut], Florian Detsch [aut], Christoph Reudenbach [aut], Stefan Woellauer [aut], Spaska Forteva [ctb], Thomas Nauss [ctb], Edzer Pebesma [ctb], Kenton Russell [ctb], Michael Sumner [ctb], Jochen Darley [ctb], Pierre Roudier [ctb], Patrick Schratz [ctb], Environmental Informatics Marburg [ctb], Lorenzo Busetto [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.