This function produces an interactive view of the extent/bbox of the supplied spatial object
viewExtent(x, map = NULL, map.types = NULL, popup = NULL, lwd = 1,
alpha = 0.9, alpha.regions = 0.1, color = "#6666ff",
homebutton = TRUE, layer.name = deparse(substitute(x)),
native.crs = FALSE, ...)addExtent(map, data, popup = NULL, ...)
either a Raster*, sf* or Spatial* object
a leaflet map the extent should be added to. If NULL
standard background layers are cretaed
#' @param maxpixels integer > 0. Maximum number of cells to use for the plot.
If maxpixels < ncell(x)
, sampleRegular is used before plotting.
character spcifications for the base maps. see http://leaflet-extras.github.io/leaflet-providers/preview/ for available options.
a list
of HTML strings with the popup contents, usually
created from popupTable
. See addControl
for
details.
line width of the rectangle.
opacity of the lines or points
opacity of the fills or the raster layer(s)
color (palette) for points/polygons/lines
logical, whether to add a zoom-to-layer button to the map. Defaults to TRUE
the name of the layer to be shown on the map
logical whether to reproject to web map coordinate reference system (web mercator - epsg:3857) or render using native CRS of the supplied data (can also be NA). Default is FALSE which will render in web mercator. If set to TRUE now background maps will be drawn (but rendering may be much quicker as no reprojecting is necessary). Currently only works for simple features.
additional arguments passed on to addRectangles
either a Raster*, sf* or Spatial* object
addExtent
: add extent/bbox of spatial objects interactively
viewExtent(poppendorf)
viewExtent(breweries)
viewExtent(franconia) + breweries
viewExtent(trails) + trails + breweries
Run the code above in your browser using DataLab