You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently generate "collision circle" geometry in the background using tile coordinates (in collision_feature.js). After #5150, most collision detection logic is run in the foreground using viewport coordinates. At render time, we figure out how much space a label will take up, and then decide which of the pre-generated collision circles to use based on how far the edges of the label are from the label anchor. This step is awkward and relies on an approximation to convert back from "viewport unit distance" to "tile unit distance".
It would be cleaner to generate the collision circle geometry on the fly at render time, using viewport coordinates. Ideally we could do the circle generation at the same time we were calling placeFirstAndLastGlyph, although there are some challenges to deal with (the "label plane" used for glyph placement is not necessarily the same as the viewport plane, so some extra projection might be necessary).
This is a follow-up to PR #5150.
We currently generate "collision circle" geometry in the background using tile coordinates (in
collision_feature.js
). After #5150, most collision detection logic is run in the foreground using viewport coordinates. At render time, we figure out how much space a label will take up, and then decide which of the pre-generated collision circles to use based on how far the edges of the label are from the label anchor. This step is awkward and relies on an approximation to convert back from "viewport unit distance" to "tile unit distance".It would be cleaner to generate the collision circle geometry on the fly at render time, using viewport coordinates. Ideally we could do the circle generation at the same time we were calling
placeFirstAndLastGlyph
, although there are some challenges to deal with (the "label plane" used for glyph placement is not necessarily the same as the viewport plane, so some extra projection might be necessary)./cc @ansis @anandthakker
The text was updated successfully, but these errors were encountered: