mapedit (version 0.6.0)

drawFeatures: Draw (simple) features on a map

Description

Draw (simple) features on a map

Usage

drawFeatures(
  map = NULL,
  sf = TRUE,
  record = FALSE,
  viewer = shiny::paneViewer(),
  title = "Draw Features",
  editor = c("leaflet.extras", "leafpm"),
  editorOptions = list(),
  ...
)

Arguments

map

a background leaflet or mapview map to be used for editing. If NULL a blank mapview canvas will be provided.

sf

logical return simple features. The default is TRUE. If sf = FALSE, GeoJSON will be returned.

record

logical to record all edits for future playback.

viewer

function for the viewer. See Shiny viewer. NOTE: when using browserViewer(browser = getOption("browser")) to open the app in the default browser, the browser window will automatically close when closing the app (by pressing "done" or "cancel") in most browsers. Firefox is an exception. See Details for instructions on how to enable this behaviour in Firefox.

title

string to customize the title of the UI window.

editor

character either "leaflet.extras" or "leafpm"

editorOptions

list of options suitable for passing to either leaflet.extras::addDrawToolbar or leafpm::addPmToolbar.

...

additional arguments passed on to editMap.

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