Closed woodwards closed 4 months ago
This seems to work? I'll test it more.
data <- input$map_draw_all_features # list
data <- jsonlite::toJSON(data, auto_unbox = TRUE) # string
data <- geojsonio::geojson_sf(data) # sf
This seems to work well!
I have included this approach in this example:
browseURL(system.file("examples/shiny/draw-events/app.R", package = "leaflet.extras"))
I am using addDrawToolbar to draw polygons on my leaflet("map"), and then I want to capture them (ideally to sf) using
input$map_draw_all_features
.However it seems the returned list is not compatible with geojson_list. Am I doing something wrong or is this a "feature request"?
Thanks so much for this excellent tool(bar).