This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
[core][tile mode] Reduce cut-off labels (part 2) - #16369
Merged
Merged
Conversation
pozdnyakov
force-pushed
the
mikhail_tile_mode_placement_fixes_2
branch
from
April 2, 2020 11:10
39c284c to
2eed488
Compare
pozdnyakov
force-pushed
the
mikhail_tile_mode_placement_fixes_2
branch
from
April 2, 2020 12:42
d45aaae to
c9a712c
Compare
tmpsantos
reviewed
Apr 2, 2020
tmpsantos
reviewed
Apr 2, 2020
tmpsantos
left a comment
Contributor
There was a problem hiding this comment.
Overall LGTM, but would be great if we could have more 👀 here.
alexshalamov
reviewed
Apr 3, 2020
Contributor
Author
|
@alexshalamov @tmpsantos I've extracted render tests changes to a separate pr #16380 and considered your comments there, ptal. |
pozdnyakov
force-pushed
the
mikhail_tile_mode_placement_fixes_2
branch
3 times, most recently
from
April 6, 2020 16:17
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.
pozdnyakov
force-pushed
the
mikhail_tile_mode_placement_fixes_2
branch
from
April 7, 2020 11:48
2bcf354 to
c1cf1da
Compare
pozdnyakov
force-pushed
the
mikhail_tile_mode_placement_fixes_2
branch
from
April 7, 2020 15:56
c1cf1da to
4327c2e
Compare
alexshalamov
approved these changes
Apr 8, 2020
alexshalamov
left a comment
Contributor
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Thanks for the proposal! will consider it separately
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now, the intersecting symbols are placed across all layers symbol by symbol according to the following rules:
vertical & horizontal -> vertical -> horizontalFixes https://github.com/mapbox/mapbox-gl-native-team/issues/223