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

Generate collision circles in foreground #5474

Closed
ChrisLoer opened this issue Oct 17, 2017 · 1 comment
Closed

Generate collision circles in foreground #5474

ChrisLoer opened this issue Oct 17, 2017 · 1 comment

Comments

@ChrisLoer
Copy link
Contributor

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

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

No branches or pull requests

2 participants