I've been using leaflet.extras in shiny to export the features drawn with the toolbar to then be able to reimport them later. I have been having issues with getting it to reimport in the same way as when it was exported.
When I export a circle from the _draw_new_feature event (or similar) using jsonlite::toJSON(<feature>, auto_unbox = TRUE) then put this in a addGeoJSONv2 it won't recreate it as a circle but rather a point/marker, It is similar story for the other feature types that can be created through the draw tool. Is there anyway that I can get this back as original type drawn?
I also have some code that will store a user entered name by a lookup on the _leaflet_id from each feature. When the features are added back the _leaflet_id of course changes. Is there a nice way to programmatically get the new _leaflet_ids out in some way such that I can update a lookup without using the draw tools manually?
I've been using leaflet.extras in shiny to export the features drawn with the toolbar to then be able to reimport them later. I have been having issues with getting it to reimport in the same way as when it was exported.
When I export a circle from the
_draw_new_featureevent (or similar) usingjsonlite::toJSON(<feature>, auto_unbox = TRUE)then put this in aaddGeoJSONv2it won't recreate it as a circle but rather a point/marker, It is similar story for the other feature types that can be created through the draw tool. Is there anyway that I can get this back as original type drawn?I also have some code that will store a user entered name by a lookup on the
_leaflet_idfrom each feature. When the features are added back the_leaflet_idof course changes. Is there a nice way to programmatically get the new_leaflet_ids out in some way such that I can update a lookup without using the draw tools manually?