Replies: 7 comments
-
|
Awesome! Excellent timing - I've got a branch (not pushed) that's working on the same thing. I'll ask you to take a look / add anything you think is missing. The big challenge I've had with implementing I ended up going with a But I do like the implementation you have where we can set up |
Beta Was this translation helpful? Give feedback.
-
|
I had that exact same challenge with the timing issue. The A callback approach if it's working seems good? I'm not sure if the code is visible so i can't peek myself! My implementation with the Shiny input and two observers seems to be really smooth on the user side and definitely seems to resolve timing issues, but it does seem clunky from a coding-in-R perspective. B/c it returns the raw JSON and requires the final processing in R. One possibility would be to make the a function like |
Beta Was this translation helpful? Give feedback.
-
|
I pushed the branch I'm working on: https://github.com/walkerke/mapgl/tree/query-rendered-features I'm still seeing the timing issues, unfortunately. That's my big hesitation with merging this feature, it has to "just work" without users needing to do tricks in Shiny. |
Beta Was this translation helpful? Give feedback.
-
|
hmm, looks like this is a known issue in the underlying libraries: mapbox/mapbox-gl-js#4222. I think clear documentation will be important to help users with this. |
Beta Was this translation helpful? Give feedback.
-
|
Also, to be clear, the approach with shiny observers wasnt having the timing issue -- the minimal app above with my current mapgl branch works. I was noticing the timing issue coming up when i was trying my initial approaches. |
Beta Was this translation helpful? Give feedback.
-
|
Definitely. My hangup was always that I was trying to combine If |
Beta Was this translation helpful? Give feedback.
-
|
I needed the minimal implementation for a project so I'm merging that today to main; let's keep discussing the other enhancements as well! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I implemented a set of new shiny inputs to take advantage of maplibre features like queryRenderedFeatures and querySourceFeatures already in my branch of this package. I'm not doing a pull request yet because i'm not sure these have wider applicability and there's definitely room to improve on my current implementations.
My current implementation has new functions in the shiny.R set of functions to query rendered features of a particular layer or source features -- which to me is really cool to pull geometries and properties from the geojson underlying the base map -- I think this has potential to be a really cool interface with resources like openstreetmap.
I also have a function, analogous to the enable_hover_events function @walkerke added to alter my hover features implementation, which updates a shiny input (
__bbox_features), with all features from a given layer currently in the map viewport. It seems really fast and performant! (I wanted to play with this in one of my own projects, and felt this approach could be a big improvement over using the_bboxinput and doing a spatial filter in R.Starting the discussion so folks are aware, but not yet a pull request.
Also, here is a minimal shiny app to show these features as my branch currently implements them!
Beta Was this translation helpful? Give feedback.
All reactions