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

Symbol features are not returned by queryRenderedFeatures #3534

Closed
lucaswoj opened this issue Nov 3, 2016 · 2 comments · Fixed by #3536
Closed

Symbol features are not returned by queryRenderedFeatures #3534

lucaswoj opened this issue Nov 3, 2016 · 2 comments · Fixed by #3536

Comments

@lucaswoj
Copy link
Contributor

lucaswoj commented Nov 3, 2016

GL JS master isn't returning any symbol features from Map#queryRenderedFeatures. Why isn't this causing any test-suite failures? The bug bisects to #3478.

cc @jfirebaugh @mourner @mapsam

mapbox-gl-js version: master as of 46a73c4 / #3478

Steps to Trigger Behavior

call Map#queryRenderedFeatures at a point with a symbol feature

(tricky to provide a jsbin because this bug occurs only in master)

Expected Behavior

the symbol feature is returned

Actual Behavior

the symbol feature is not returned

@jfirebaugh
Copy link
Contributor

I can take a look later today. I believe all of the query tests are for very simple styles, usually with only one layer. One thing I would check is if this only shows up if there are other layers present with the symbol layer.

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Nov 3, 2016

Debugging Notes

  • the bug was introduced in Encapsulate SymbolBucket's unique requirements #3478
  • the bug does not manifest itself on a map with only symbol layers & background layers
  • the bug does manifest itself on a map with a symbol layer and a line or fill layer
  • the symbol in the StructArray returned by CollisionTile#queryRendered has an incorrect bucketIndex

Diagnosis

As of #3478, SymbolBucket no longer inherits from Bucket.

Most of the constructor logic from Bucket was copied to SymbolBucket but the initialization of the index property was not https://github.com/mapbox/mapbox-gl-js/pull/3478/files#diff-621f09c210ab28c3dbf7bc1f0f03c6b2R116

Next Steps

  • initialize index within the SymbolBucket constructor
  • add a regression test to mapbox-gl-test-suite
  • 🚢

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

Successfully merging a pull request may close this issue.

2 participants