Skip to content
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

Open
ansis opened this issue Jan 18, 2018 · 6 comments
Open

Implementing feature interactivity #6022

ansis opened this issue Jan 18, 2018 · 6 comments

Comments

@ansis
Copy link
Contributor

ansis commented Jan 18, 2018

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

Related tickets:

@mb12
Copy link

mb12 commented Jan 18, 2018

@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.

  1. Listen to event (tap, click, hover, touch etc).
  2. Call Map.queryRenderedFeatures (usually for specific style layers)
  3. Update style depending on results of query. (Change filter, or any other property).

@ansis
Copy link
Contributor Author

ansis commented Jan 19, 2018

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.

@andrewharvey
Copy link
Collaborator

style-spec hover and active style properties: #200

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.

@ansis
Copy link
Contributor Author

ansis commented Jan 19, 2018

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.

@andrewharvey yep, that would definitely be an advantage of Option 1 here. Do you have any thoughts on the open questions there?

@andrewharvey
Copy link
Collaborator

@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.

@kkaefer
Copy link
Contributor

kkaefer commented Jan 23, 2018

/cc @mapbox/studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants