New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way of flushing the old data from $finished when using singleFeature=TRUE mapedit in a Shiny app? #106
Comments
I also came across this issue today, it would be great to have a fix. |
I also have struggled to solve this issue, the same issue occurs in the quakes r-spatial shiny example. After using the mapedit select polygons tool the plot successfully renders; however, if you attempt to clear the selected polygons using the delete tool, the plot caches the intersected values and fails to clear the plot. Is there any way to force the delete tool to flush these values? If you attempt to delete multiple polygons at the same time there is also an additional error "argument is of length zero". This would be extremely useful for shiny apps that use the mapedit tool to select polygons/points and reference a secondary dataset to generate a plot. As it stands I cannot determine how to cleanly implement this without a clear plot/df button. |
@tim-salabim @timelyportfolio Is it likely we will see a fix for this problem in coming releases? I would love to use |
@eastcoasting I should have some time this week/weekend to take a look. Thanks for the patience. |
@eastcoasting @fawda123 @jennet @tim-salabim I think I found a solution in 027b2da. Please test if you have a moment |
@timelyportfolio works for me, thanks for the fix!
|
@timelyportfolio Works for me thank you very much! |
I'll close the issue and hopefully submit to CRAN by end of weekend. Thanks again to all who participated and helped. |
@timelyportfolio I came across this problem recently. Installing the package from github did work for me, but not from CRAN (as of October 29, 2020). |
I have a shiny app that uses mapedit to allow the user to draw around an area of the country they are interested in, and then the app gets placemarks from a number of different datasets. I have set mapedit to
singleFeature=TRUE
when creating the map, and I found that regardless of this, the app was returning data from "old" drawn features. I've narrowed this down to the fact that each time the user draws a new area, this gets returned (along with old areas, even though they have been deleted) in the $finished values.e.g.
Simple feature collection with 1 feature and 2 fields
Simple feature collection with 2 features and 2 fields
Simple feature collection with 1 feature and 2 fields
, as only last feature is deleted.Basically - is there a way to force mapedit to only retain the most recently drawn feature if the map is set to single feature only? If not, I'll have to add to my code to only retrieve data for the last feature (as shown on
verbatimTextOutput("feature_of_interest")
in the code below), but I think perhaps my problem is that I've not set up mapedit correctly, or I'm missing something else obvious.I've done a simple version showing this here:
The text was updated successfully, but these errors were encountered: