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

'queryRenderedSymbols' mixes results from different sources #5554

Closed
ChrisLoer opened this issue Oct 30, 2017 · 0 comments
Closed

'queryRenderedSymbols' mixes results from different sources #5554

ChrisLoer opened this issue Oct 30, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@ChrisLoer
Copy link
Contributor

Another bug discovered in the native port of #5150...

In CollisionIndex#queryRenderedSymbols, we filter results to match the tile of the FeatureIndex doing the querying:

https://github.com/mapbox/mapbox-gl-js/blob/master/src/symbol/collision_index.js#L255

We also need to filter based on the source -- otherwise we'll return results from multiple sources as long as they're on the same tile. The results are in the form of an index into a tile/source-specific collision array, so what will actually get returned after the array lookup is pretty much undefined.

I think the fix here is:

  • Store the source ID of everything in the collision grid, along with the tile ID
  • Use the source ID in the query to filter results

Needs a two-source query test.

/cc @ansis @anandthakker

@ChrisLoer ChrisLoer self-assigned this Oct 30, 2017
@ChrisLoer ChrisLoer added this to the v0.41.1 milestone Oct 30, 2017
ChrisLoer added a commit that referenced this issue Oct 31, 2017
Fixes issue #5554, in which unrelated symbols from source B could be returned in a query that returned symbols from source A.
@ChrisLoer ChrisLoer modified the milestones: v0.41.1, v0.42 Oct 31, 2017
jfirebaugh pushed a commit that referenced this issue Nov 2, 2017
Fixes issue #5554, in which unrelated symbols from source B could be returned in a query that returned symbols from source A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants