mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

[tile mode] Simultaneous usage of `symbol-avoid-edges` and `symbol-text-variable-anchor` #16476

Closed pozdnyakov closed 4 years ago

pozdnyakov commented 4 years ago

At the moment, simultaneous usage of symbol-avoid-edges=true and symbol-text-variable-anchor properties in the tile mode might cause symbol duplications.

The reason: when the label anchor is located at the tile border, both neighbor tiles might place this label using different anchors.

label_dup

Possible solution: we should define generic rules to be applied across the tiles, that would provide deterministic placement. One option to consider: we do not try the next variable anchor if the placement with the previous anchor failed due to symbol-avoid-edges limitations (i.e. label was crossing the border).