-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core][tile mode] Reduce cut-off labels (part 2) #16369
Conversation
39c284c
to
2eed488
Compare
d45aaae
to
c9a712c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, but would be great if we could have more 👀 here.
@alexshalamov @tmpsantos I've extracted render tests changes to a separate pr #16380 and considered your comments there, ptal. |
d3ce30c
to
2bcf354
Compare
Make `placeSymbol()` a method and introduce copiable `PlacementContext`.
Now, the intersecting symbols are placed across all layers according to the following rules: 1) First we look, which of the tile border(s) the symbol intersects and prioritize the the symbol accordingly (high priority -> low priority): vertical & horizontal -> vertical -> horizontal 2) For the symbols that intersect the same tile border(s), assuming the tile border split symbol into several sections, we look at the minimal section length. The symbol with a larger minimal section length is placed first. 3) Finally, for the symbols that intersect the same tile border(s), and have equal minimal section length, we look at the anchor Y cordinate.
2bcf354
to
c1cf1da
Compare
c1cf1da
to
4327c2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
One idea, maybe we should use overlap area as an input for prioritizing placement for overlapping labels.
if (flagsA != flagsB) return flagsA > flagsB; | ||
// If both intersects the same border(s), look for a more noticable cut-off. | ||
if (a.status.minSectionLength != b.status.minSectionLength) { | ||
return a.status.minSectionLength > b.status.minSectionLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should vertical and horizontal length be checked separately? Also, should it be total overlap area vs single 'section length'? Label that is in a tile corner can have bigger overlap area, yet, smaller section length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the proposal! will consider it separately
Now, the intersecting symbols are placed across all layers symbol by symbol according to the following rules:
vertical & horizontal -> vertical -> horizontal
Fixes https://github.com/mapbox/mapbox-gl-native-team/issues/223