Description Usage Arguments Details Value Examples
Interactively Edit a Map
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 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(), ...)
|
x |
|
... |
other arguments for |
targetLayerId |
|
sf |
|
ns |
|
record |
|
viewer |
|
crs |
see |
title |
|
editor |
|
editorOptions |
|
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
sf
simple features or GeoJSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.