-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Re-implement "avoid edges" for static map tile generation #12461
Comments
I spent some time looking at one of our core navigation styles using an updated version of api-gl. My impressions were:
It occurs to me that since this only matters for api-gl, we could even get away with skipping most of the logic necessary for handling off-axis (e.g pitched) tile boundaries. My gut right now is that this is small-medium fix difficulty and small-medium priority -- i'm going to drop it off my immediate todo list, but anyone with more perspective feel free to bump it back up. cc @lilykaiser |
Misread this 🤦♀️ I will unassign you |
I looked through a bunch of mapbox core styles, and we barely use We should still re-implement support for As part of re-implementing
|
- Fixes issue #12461. - Only implement "avoid edges" in MapMode::Tile since it's no longer relevant in Static or Continuous mode. - New: Force "avoid edges" to "true" for line labels, since in tile mode they'll always clip poorly at tile boundaries. - Remove unused "withinPlus0/inside" logic.
- Fixes issue #12461. - Only implement "avoid edges" in MapMode::Tile since it's no longer relevant in Static or Continuous mode. - New: Force "avoid edges" to "true" for line labels, since in tile mode they'll always clip poorly at tile boundaries. - Remove unused "withinPlus0/inside" logic.
- Fixes issue #12461. - Only implement "avoid edges" in MapMode::Tile since it's no longer relevant in Static or Continuous mode. - New: Force "avoid edges" to "true" for line labels, since in tile mode they'll always clip poorly at tile boundaries. - Remove unused "withinPlus0/inside" logic.
- Fixes issue #12461. - Only implement "avoid edges" in MapMode::Tile since it's no longer relevant in Static or Continuous mode. - New: Force "avoid edges" to "true" for line labels, since in tile mode they'll always clip poorly at tile boundaries. - Remove unused "withinPlus0/inside" logic.
Fixed in #12520. |
When we implemented global collision detection (#10436), we removed the per-tile implementation of the
symbol-avoid-edges
style property because it was no longer necessary -- global collision detection handled the tile boundaries. For static tile generation, we relied on running "global" collision detection on the tile including the symbols in its buffers, in order to handle collisions at the boundary.That approach works for point labels, but it can break down with line labels because the anchors can get placed at different locations in neighboring tiles. I don't know how common this will actually be in practice, but in theory it will cause more bad label clipping at tile boundaries in api-gl.
I think to implement this we'd project the tile boundaries into viewport space and then do a check against that bounding geometry before we tried testing the line label against the rest of the collision index.
/cc @ansis @jfirebaugh @ian29
The text was updated successfully, but these errors were encountered: