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

[Core] Ensure queryRenderedFeatures accounts for icons with *-offset … #13105

Merged
merged 5 commits into from
Oct 18, 2018

Conversation

ryanhamley
Copy link
Contributor

Fixes #12909 and implements #11872

This is a pretty straightforward port of mapbox/mapbox-gl-js#6631 which allows icons with icon-rotate and icon-offset to show up in queryRenderedFeatures results as expected.

@ryanhamley ryanhamley added GL JS parity For feature parity with Mapbox GL JS Core The cross-platform C++ core, aka mbgl needs changelog Indicates PR needs a changelog entry prior to merging. labels Oct 16, 2018
@ryanhamley ryanhamley force-pushed the fix-rotated-icon-query branch from 0d255ac to d5dfa1b Compare October 16, 2018 01:02
@mollymerp mollymerp requested a review from ChrisLoer October 17, 2018 17:01
@mollymerp
Copy link
Contributor

looks like you need to update the tests in cross_tile_symbol_index.test.cpp – you can run the tests locally by using the mbgl-test scheme in xcode or make test in terminal

const Point<float> bl = util::rotate(Point<float>(x1, y2), rotateRadians);
const Point<float> br = util::rotate(Point<float>(x2, y2), rotateRadians);

const float xMin = std::min({tl.x, tr.x, bl.x, br.x});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you bring over the comments from GL JS here or something similar? I think the "we have to represent on-axis geometry, so take the envelope of the rotated geometry" step is fairly non-obvious to someone casually browsing the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just copied over your comments

@ChrisLoer
Copy link
Contributor

Overall this looks great to me! 🚀

@ryanhamley
Copy link
Contributor Author

@mollymerp Thanks for pointing that out! I was having trouble figuring out why the tests broke once I rebased against master.

@ryanhamley ryanhamley force-pushed the fix-rotated-icon-query branch from d5dfa1b to 10e9fd2 Compare October 17, 2018 23:16
Copy link
Contributor

@ChrisLoer ChrisLoer left a comment

Choose a reason for hiding this comment

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

🍏 after squashing the fixup commits

@ryanhamley ryanhamley merged commit 0c6b162 into master Oct 18, 2018
@ryanhamley ryanhamley deleted the fix-rotated-icon-query branch October 18, 2018 19:14
@friedbunny friedbunny removed needs changelog Indicates PR needs a changelog entry prior to merging. labels Oct 31, 2018
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 GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants