Learn R Programming

mapview (version 2.0.1)

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, 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, ...)

Arguments

x

either a Raster*, sf* or Spatial* object

map

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.

map.types

character spcifications for the base maps. see http://leaflet-extras.github.io/leaflet-providers/preview/ for available options.

popup

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

lwd

line width of the rectangle.

alpha

opacity of the lines or points

alpha.regions

opacity of the fills or the raster layer(s)

color

color (palette) for points/polygons/lines

homebutton

logical, whether to add a zoom-to-layer button to the map. Defaults to TRUE

layer.name

the name of the layer to be shown on the map

native.crs

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

data

either a Raster*, sf* or Spatial* object

Functions

  • addExtent: add extent/bbox of spatial objects interactively

Examples

Run this code

viewExtent(poppendorf)
viewExtent(breweries)
viewExtent(franconia) + breweries
viewExtent(trails) + trails + breweries


Run the code above in your browser using DataLab