-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Implementing feature interactivity #6022
Comments
@ansis Can you please clarify what kind of new use cases this will address? At the moment, for interactivity something like the following works for almost all uses cases.
|
hi @mb12, I probably should have called this issue improving feature interactivity. You're right, a lot of this is kind of possible but we're trying to make it easier and make it more performant. Currently it can take a lot of extra code to do something that should be simple, like setting a hover style. And when you get it working it turns out that the current approach is really slow. We're hoping to get to the point where interactive behavior, like a hover style, is easy to add and has no noticeable latency. |
I like the idea of building this into the style spec somehow since it allows the map designer to control the visual elements of the hover or active states of a feature directly in Studio rather than in code. At the moment you have to agree on some kind of convention with the layer names like "layer-hover", "layer-active" and it's a bit messy fiddling with the filter on those layers in Studio so the designer can see what it will look like when those states are active (potentially together). On the other hand leaving thin convention up to the user to keep the style spec as universal as possible is also a valid argument. |
@andrewharvey yep, that would definitely be an advantage of Option 1 here. Do you have any thoughts on the open questions there? |
@ansis You've done a great job covering everything in your 3 tickets, thank you for that. 👍 Agree with all the points in the motivation, as these are all things that people implementing GL JS apps do run into. |
/cc @mapbox/studio |
At a high level I think feature interactivity can be split into two main pieces:
Both of these proposals have plenty of other open questions that could be split into separate issues.
One open question is how to merge features across tile boundaries:
Next steps
@kkaefer @asheemmamoowala @mollymerp @anandthakker @mourner @lucaswoj
It would be good to get feedback on these proposals. What seems like a good idea and what doesn't? What alternative options did I miss?
After we figure out the high level direction we can start splitting up the design and implementation work into pieces.
@asheemmamoowala compiled list of all relevant issues:
Suggestions/Requests
For GeoJSON sources, can query*Features return the original geometry? #5639
Feature querying should return existing annotations mapbox-gl-native#6178
mbgl::style::GeoJSONSource should have GeoJSON getter mapbox-gl-native#7376
Related tickets:
The text was updated successfully, but these errors were encountered: