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

Adjust queryRenderedSymbols with tile perspective approximation #4792

Merged
merged 2 commits into from
Jun 6, 2017

Conversation

ChrisLoer
Copy link
Contributor

This is a back-port from mapbox/mapbox-gl-native#9009. Although queryRenderedSymbols won't match collision boxes exactly (because they're partially calculated in the GPU), this change gets the results of queryRenderedSymbols closer to what's shown on the screen by using the tile-based approximation of the pitch-scaling ratio.

To get an idea for what this changes, look at the actual.png generated for query/symbol-features-in/pitched-screen. Before the change, the top symbol wouldn't be included in the results (even though you can see the rendered collision box overlaps with the query geometry).

@ansis

 - Cover more tiles
 - Include features whose collision box only partially intersects query geometry
 - Add text to the features (making the features bigger makes pitch-scaling easier to test)
 - Ignore on native until pitch scaling changes go in
@ChrisLoer ChrisLoer requested a review from ansis June 6, 2017 17:19
Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ChrisLoer ChrisLoer merged commit e13efe2 into master Jun 6, 2017
@ChrisLoer ChrisLoer deleted the cloer_perspective_symbol_queries branch June 7, 2017 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants