Skip to content

Reimporting draw toolbar features #234

@oliverbeagley-pgg

Description

@oliverbeagley-pgg

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions