knitr::opts_chunk$set(fig.width = 8.83)

mapviewOptions can be used to set several plotting parameters (arguments) globally, meaning that they will be valid for as long as the session is active.

A call to mapviewOptions() will show all options and their default values in the console

library(mapview)
mapviewOptions()

In detail, these are:


To get the current value of a certain option use mapviewGetOption()

mapviewGetOption("basemaps")

To set certain options use mapviewOptions()

mapviewOptions(basemaps = c("Esri.WorldShadedRelief", "OpenStreetMap.DE"),
               raster.palette = grey.colors,
               vector.palette = colorRampPalette(c("snow", "cornflowerblue", "grey10")),
               na.color = "magenta",
               layers.control.pos = "topright")

mapviewOptions()

mapview(breweries, zcol = "founded", legend = TRUE)

These options will now be available until the current session is closed. i.e. you quit R

library(plainview)

mapview(poppendorf[[5]])

To change these options permanently, i.e. across sessions, you could place a call to mapviewOptions in your .Rprofile so that they will be set everytime you start R

To revert to factory settings use default = TRUE

mapviewOptions(default = TRUE)
mapview(franconia)



environmentalinformatics-marburg/mapview documentation built on April 18, 2024, 4:40 p.m.