Quickly and conveniently create interactive visualisations of spatial data with or without background maps. Attributes of displayed features are fully queryable via pop-up windows. Additional functionality includes methods to visualise true- and false-color raster images and bounding boxes.
mapview provides functions to very quickly and conveniently create interactive visualisations of spatial data. It was created 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.
The main user relevant functions are:
mapview- view (multiple) spatial objects on a set of background maps
viewExtent- view extent / bounding box of spatial objects
viewRGB- view RGB true- or false-color images of raster objects
mapshot- easily save maps (including leaflet maps) as
png(or other image formats)
Functions that have been deprecated/deleted recently:
addHomeButton- deprecated, use package leafem instead
addLogo- deprecated, use package leafem instead
addFeatures- deprecated, use package leafem instead
addMouseCoordinates- deprecated, use package leafem instead
addExtent- deprecated, use package leafem instead
addImageQuery- deprecated, use package leafem instead
sync- deprecated, use package leafsync instead
slideView- deprecated, use package slideview instead
cubeView- deprecated, use package cubeview instead
plainview- deprecated, use package plainview instead
popupImage- deprecated, use package leafpop instead
addLargeFeatures- use leafgl
::addGL*functions instead - currently not on CRAN!
Objects of the following spatial classes are supported:
For CRAN release version of mapview use
To install the development version install the devtools package.
The most basic call
will produce a web map visualisation of the breweries data with the following components:
Please file bug reports and feature requests at https://github.com/r-spatial/mapview/issues
In case of Pull Requests, please make sure to submit them to the
develop branch of this repository.
methodto specify the method used for resampling of raster data. #123
zcolwas supplied. #124
addMouseCoordinates has gained argument 'style' to specify whether to show 'basic' (lat, lon, zoom) or 'detailed' (x, y, epsg, proj4, lat, lon, zoom) information. Factory-fresh default is 'detailed'.
addLogo has gained argument 'alpha' to set the opacity of the image.
Someone draws quickest...
added new method for list of objects so that we can do mapview(list(x, y, z)) which is great for computational outputs such as lapply.
slideView has gained arguments 'label1' and 'label2' to supply slider names for the respective images, img1 and img2.
new popup layout (making more use of the space available).
added new function addLargeFeatures to render large datasets of up to ~100k features which is used automatically. To lower/elevate the threshold use maxpoints = ... (See ?mapview for details).
mapview methods for all basic sf classes (XY/sfg, sfc, sf)
added support for sf to "+"
we can now render features/objects with arbitrary CRS (without map background) by setting 'native.crs = TRUE'.
mapview will now decide which default base map to use based on average luminence of rendered colors.
mapview now provides subtle highlighting of polygons (changing opacity slightly) and lines (changing thickness).
plainView, slideView and cubeView have gained argument legend. default is TRUE. Legends only available for non-RGB methods!
new data sets:
data sets 'breweries91', 'gadmCHE' and 'atlStorms2005' have been deleted and moved to leaflet.
@objectwill be of class sf (regardless of input class).