A wrapper for mapview::mapview() that drops list columns and makes it
easier to quickly specify a zcol value.
Usage
mapview_ext(x, zcol = NULL, remove_na = FALSE, ...)
mapview_exif(
path = NULL,
fileext = "jpeg",
popup = TRUE,
tooltip = FALSE,
images = NULL,
width = 320,
...
)
mapview_popup_img(
images,
popup = TRUE,
tooltip = FALSE,
map = NULL,
width = 320,
...,
call = caller_env()
)Arguments
- x
a
Raster*orSpatial*orSatelliteorsforstarsobject or a list of any combination of those. Furthermore, this can also be adata.frame, anumeric vectoror acharacter stringpointing to a tile image folder or file on disk. If missing, a blank map will be drawn. A value of NULL will return NULL.- zcol
attribute name(s) or column number(s) in attribute table of the column(s) to be rendered. See also Details.
- remove_na
If
TRUEandzcolis notNULL, filterNAvalues from the data frame column defined byzcolbefore passing tomapview::mapview()- ...
Arguments passed on to
mapview::mapviewmaxpixelsinteger > 0. Maximum number of cells to use for the plot. If maxpixels <
ncell(x), sampleRegular is used before plotting.col.regionscolor (palette) pixels. See
levelplotfor details.atthe breakpoints used for the visualisation. See
levelplotfor details.na.colorcolor for missing values
use.layer.namesshould layer names of the Raster* object be used?
map.typescharacter specifications for the base maps. see https://leaflet-extras.github.io/leaflet-providers/preview/ for available options.
alpha.regionsopacity of the fills of points, polygons or raster layer(s)
legendshould a legend be plotted
legend.opacityopacity of the legend
trimshould the raster be trimmed in case there are NAs on the edges
verboseshould some details be printed during the process
layer.namethe name of the layer to be shown on the map. By default this is the character version of whatever is passed to
x. NOTE: This is being passed to underlying leaflet functions as the group argument. So if you use mapview to set up a map and want to refer to a certain layer later on, this is what you should refer to ingroup.homebuttonlogical, whether to add a zoom-to-layer button to the map. Defaults to TRUE
native.crslogical 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.
methodfor raster data only (raster/stars). Method used to compute values for the resampled layer that is passed on to leaflet. mapview does projection on-the-fly to ensure correct display and therefore needs to know how to do this projection. The default is 'bilinear' (bilinear interpolation), which is appropriate for continuous variables. The other option, 'ngb' (nearest neighbor), is useful for categorical variables. Ignored if the raster layer is of class
factorin which case "ngb" is used.labelFor vector data (sf/sp) a character vector of labels to be shown on mouseover. See
addControlfor details. For raster data (Raster*/stars) a logical indicating whether to add image query.query.typefor raster methods only. Whether to show raster value query on
'mousemove'or'click'. Ignored iflabel = FALSE.query.digitsfor raster methods only. The amount of digits to be shown by raster value query. Ignored if
label = FALSE.query.positionfor raster methods only. The position of the raster value query info box. See
positionargument ofaddLegendfor possible values. Ignored iflabel = FALSE.query.prefixfor raster methods only. a character string to be shown as prefix for the layerId. Ignored if
label = FALSE.viewer.suppressdeprecated. Use
mapviewOptions(viewer.suppress = TRUE/FALSE)instead.hideeither a logical, a vector of layer names or a vector of layer indices. See Details for more information on what exactly it does for different raster types.
bandfor stars layers, the band number to be plotted.
panename of the map pane in which to render features. See
addMapPanefor details. Currently only supported for vector layers. Ignored ifcanvas = TRUE. The default"auto"will create different panes for points, lines and polygons such that points overlay lines overlay polygons. Set toNULLto get default leaflet behaviour where allfeatures are rendered in the same pane and layer order is determined automatically/sequentially.canvaswhether to use canvas rendering rather than svg. May help performance with larger data. See https://leafletjs.com/index.html#canvas for more information. Only applicable for vector data. The default setting will decide automatically, based on feature complexity.
burstwhether to show all (TRUE) or only one (FALSE) layer(s). See also Details.
colorcolor (palette) for points/polygons/lines
cexattribute name(s) or column number(s) in attribute table of the column(s) to be used for defining the size of circles
lwdline width
alphaopacity of lines
na.alphaopacity of missing values
highlighteither
FALSE,NULLor a list of styling options for feature highlighting on mouse hover. SeehighlightOptionsfor details.maxpointsthe maximum number of points making up the geometry. In case of lines and polygons this refers to the number of vertices. See Details for more information.
tmswhether the tiles are served as TMS tiles.
ynumeric vector.
typewhether to render the numeric vector
xas a point"p"or line"l"plot.gridwhether to plot a (scatter plot) xy-grid to aid interpretation of the visualisation. Only relevant for the data.frame method.
xcolthe column to be mapped to the x-axis. Only relevant for the data.frame method.
ycolthe column to be mapped to the y-axis. Only relevant for the data.frame method.
aspectthe ratio of x/y axis coordinates to adjust the plotting space to fit the screen. Only relevant for the data.frame method.
crsan optional crs specification for the provided data to enable rendering on a basemap. See argument description in
st_sffor details.
- path
A path to folder or file.
- fileext
File extension. Defaults to "jpeg".
- popup
If
TRUE, add a popup image to a leaflet map; defaultsTRUE.- tooltip
logical, whether to show image(s) as popup(s) (on click) or tooltip(s) (on hover).
- images
A simple feature object with columns for the image path/url, image width, and image height.
- width
the width of the image(s) in pixels.
- map
an optional existing map to be updated/added to.
- call
The execution environment of a currently running function, e.g.
caller_env(). The function will be mentioned in error messages as the source of the error. See thecallargument ofabort()for more information.
