r-spatial / mapedit

Interactive editing of spatial data in R
https://www.r-spatial.org/r/2019/03/31/mapedit_leafpm.html
Other
218 stars 33 forks source link

selectFeatures error possibly related to "draw" mode #125

Closed kerencrum closed 1 year ago

kerencrum commented 1 year ago

Hi I've been using the selectFeatures in mapview for selecting on a Large Spatial Polygons Dataframe brought in through ArcPro. The first dataset I've used works fine, but when I bring in a second dataset with the same dataframe structure I've been getting the following error:

m =mapview(LS_RE_ACS.sp.df, zcol = 'TEMP_CLUSTER_NUMBER', label ='BASE_LQ_CODE', popup = F)

selected = selectFeatures(LS_RE_ACS.sp.df, map = m , mode = "draw") Error in map$x : $ operator not defined for this S4 class

If I change the mode to "click" it produces a map in the viewer window but without any ability to select on the data. I'm really confused as to why it works on one dataset and not the other considering as far as I can tell the structure is exactly the same. First one doesn't work with selectFeatures, second image shows data that does work. image image

Please let me know if there is any other information that I can provide to help resolve this issue. Thanks!

tim-salabim commented 1 year ago

It's a bit strange that it works for one but not the other. Can you try to to pass m@map instead of m to selectFeatures()?

kerencrum commented 1 year ago

Wow, that worked! Thanks Tim!

tim-salabim commented 1 year ago

Good to hear!