Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix CollisionTile::queryRenderedSymbols query geometry #6553

Closed
wants to merge 12 commits into from

Conversation

brunoabinader
Copy link
Member

Due to a bug in CollisionTile - see #6055 (comment) for details - the results for queryRenderedFeatures for symbol features was wrong in some cases e.g. when map bearing is updated. This PR implements the proposed fix and adds both query and unit tests to verify.

In order to support the proposed query tests, two new Node.js functions are proposed: setCenter and setBearing. These are exemplified via operations inside style.json.

Fixes #6055.

@brunoabinader brunoabinader added the Core The cross-platform C++ core, aka mbgl label Oct 2, 2016
@mention-bot
Copy link

@brunoabinader, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @ansis and @kkaefer to be potential reviewers.

@brunoabinader
Copy link
Member Author

brunoabinader commented Oct 2, 2016

Next steps:

  • Test the proposed query tests on GL JS to verify if provides the same results
  • Merge native-symbol-rotated-after-insert branch into Mapbox GL test suite master.
  • Investigate the failing render tests:
    • 'text-font/chinese'
    • 'text-pitch-alignment/map-text-depthtest'
    • 'text-pitch-alignment/viewport-text-depthtest'

@brunoabinader brunoabinader force-pushed the brunoabinader-queryrenderedfeatures branch 3 times, most recently from 9484fad to 86e4098 Compare October 3, 2016 16:17
@brunoabinader
Copy link
Member Author

Commit 86e4098 fixes an issue I found out while testing for queries: when symbols were placed on tile edges e.g. { 0, 0 } they were spawning 3 other symbols on the surrounding tiles (example below):
screen shot 2016-10-03 at 3 10 42 pm

@brunoabinader
Copy link
Member Author

Heads up: Though the fixes on this PR are valid, I am still obtaining the wrong amount of features while querying for visible features as I simply zoom in and out of the map. I'll continue my investigations around the relations between FeatureIndex and CollisionTile.

@brunoabinader
Copy link
Member Author

Commit 86e4098 fixes #3563.

We were erroneously assigning a value to optional<ScreenCoordinate>
(null island), causing it to be a valid anchor for Transform::easeTo.
@brunoabinader brunoabinader force-pushed the brunoabinader-queryrenderedfeatures branch from 86e4098 to b92af8b Compare October 7, 2016 11:27
This provides a means of testing cases where an updated geometry tile
would return wrong results for `queryRenderedFeatures`.
This gives the ability to pan the map in a posterior step after initial
render for testing purposes.
Edge cases e.g. a point in null island (0, 0) makes the geometry
intersectable by the four surrounding tiles. This makes sure only the
tile that produces a valid projection in updateLayer() continues.
@brunoabinader brunoabinader force-pushed the brunoabinader-queryrenderedfeatures branch 2 times, most recently from fff496d to fe86312 Compare October 7, 2016 12:04
@brunoabinader
Copy link
Member Author

This PR is getting too big and addressing many different issues. I'm closing this in favor of separated PRs to handle each bug fix specifically.

@brunoabinader
Copy link
Member Author

This PR has been split in the following PRs and/or issues:

Fixed and/or pending review:

What's left:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map::queryPointAnnotations() -> Map::queryRenderedFeatures() returns unexpected result as map is moved
2 participants