editMap {mapedit} | R Documentation |
Interactively Edit a Map
Description
Interactively Edit a Map
Usage
editMap(x, ...)
## S3 method for class 'leaflet'
editMap(
x = NULL,
targetLayerId = NULL,
sf = TRUE,
ns = "mapedit-edit",
record = FALSE,
viewer = shiny::paneViewer(),
crs = 4326,
title = "Edit Map",
editor = c("leaflet.extras", "leafpm"),
editorOptions = list(),
...
)
## S3 method for class 'mapview'
editMap(
x = NULL,
targetLayerId = NULL,
sf = TRUE,
ns = "mapedit-edit",
record = FALSE,
viewer = shiny::paneViewer(),
crs = 4326,
title = "Edit Map",
editor = c("leaflet.extras", "leafpm"),
editorOptions = list(),
...
)
## S3 method for class ''NULL''
editMap(x, editor = c("leaflet.extras", "leafpm"), editorOptions = list(), ...)
Arguments
x |
|
... |
other arguments for |
targetLayerId |
|
sf |
|
ns |
|
record |
|
viewer |
|
crs |
see |
title |
|
editor |
|
editorOptions |
|
Details
When setting viewer = browserViewer(browser = getOption("browser"))
and
the systems default browser is Firefox, the browser window will likely not
automatically close when the app is closed (by pressing "done" or "cancel").
To enable automatic closing of tabs/windows in Firefox try the following:
input "about:config " to your firefox address bar and hit enter
make sure your "dom.allow_scripts_to_close_windows" is true
Value
sf
simple features or GeoJSON
Examples
## Not run:
library(leaflet)
library(mapedit)
editMap(leaflet() %>% addTiles())
## End(Not run)
## Not run:
# demonstrate Leaflet.Draw on a layer
library(sf)
library(mapview)
library(leaflet.extras)
library(mapedit)
# ?sf::sf
pol = st_sfc(
st_polygon(list(cbind(c(0,3,3,0,0),c(0,0,3,3,0)))),
crs = 4326
)
mapview(pol) %>%
editMap(targetLayerId = "pol")
mapview(franconia[1:2,]) %>%
editMap(targetLayerId = "franconia[1:2, ]")
## End(Not run)