Interactive viewing of spatial data in R
mapview
Interactive viewing of spatial data in R
mapview provides functions to very quickly and conveniently create interactive visualisations of spatial data. It’s main goal is to fill the gap of quick (not presentation grade) interactive plotting to examine and visually investigate both aspects of spatial data, the geometries and their attributes. It can also be considered a data-driven API for the leaflet package as it will automatically render correct map types, depending on the type of the data (points, lines, polygons, raster). In addition, it makes use of some advanced rendering functionality that will enable viewing of much larger data than is possible with leaflet. Furthermore, if you’re a fan of mapdeck (which you should!), you can choose to use it as the rendering platform instead of leaflet by setting mapviewOptions(platform = "mapdeck").
The main user relevant functions are:
mapview- view (multiple) spatial objects on a set of background
viewExtent- view extent / bounding box of spatial objectsviewRGB- view RGB true- or false-color images of raster objectsmapshot- easily save maps (including leaflet maps) ashtmland/or
png (or other image formats)
Functions that have been deprecated/deleted recently:
addHomeButton- deprecated, use package
addLogo- deprecated, use package
addFeatures- deprecated, use package
addMouseCoordinates- deprecated, use package
addExtent- deprecated, use package
addImageQuery- deprecated, use package
latticeView&sync- deprecated, use package
slideView- deprecated, use package
cubeView- deprecated, use package
plainview- deprecated, use package
popupTable,popupGraph&popupImage- deprecated, use package
addLargeFeatures- use
::addGL*
functions instead.
Objects of the following spatial classes are supported:
Brick and SpatialPixels\* / SpatialGridDataFrame) and their DataFrame version)Installation
For CRAN release version of mapview use
r
install.packages("mapview")
To install the development version you can install the remotes package.
NOTE: As of version 2.9.1 development will happen on the master branch. Please consider the develop branch obsolete.
r
remotes::install_github("r-spatial/mapview")
Usage
The most basic call
r
mapview(breweries)
will produce a web map visualisation of the breweries data with the following components:

Contact
Please file bug reports and feature requests at
