leaflet() %>%
setView(0, 0, 2) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addDrawToolbar(
targetGroup = "draw",
editOptions = editToolbarOptions(
selectedPathOptions = selectedPathOptions()
)
) %>%
addLayersControl(
overlayGroups = c("draw"),
options = layersControlOptions(collapsed = FALSE)
) %>%
addStyleEditor()
## for more examples see
# browseURL(system.file("examples/draw.R",
# package = "leaflet.extras"))
# browseURL(system.file("examples/shiny/draw-events/app.R",
# package = "leaflet.extras"))
# browseURL(system.file("examples/shiny/draw-events/draw_mouse_events.R",
# package = "leaflet.extras"))
Run the code above in your browser using DataLab