label collision algorithm improvement ideas
A bunch of issues have been opened about downsides of the current label collision algorithm. The current collision algorithm is working well enough so it's unlikely to change soon. This issue is for keeping track of all the ideas for if/when we have time to revisit the algorithm.
It makes sense to collect all these ideas in one spot because:
- they all impact each other and should be considered together
- none of these things are things we should implement for sure
ideas:
- prioritize labels that can be shown earlier in the zoom level: https://github.com/mapbox/mapbox-gl-native/issues/1690 cc @1ec5
- should it prioritize within a single layer? or can it prioritize earlier labels across all layers?
- doing it across all layers could be good for api-gl tiles? or would it cause more labelling chaos?
- make it possible to prioritize icons over text https://github.com/mapbox/mapbox-gl-js/issues/2213 cc @cammanderson
- should it prioritize icons over text in the same layer? over text in other layers?
- should it work by prioritizing icons or reprioritizing text?
- would this replace
*-optionalstyle properties?
- cross-tile label placement with global knowledge https://github.com/mapbox/mapbox-gl-js/issues/1368 cc @apachemaven
- can this / how does this fit in with raster tiles rendered by api-gl?
- is this necessary for labeling with vertically offset labels (terrain) in 3d view?
:+1: for dynamic label positions. We have some scenarios that this would greatly improve readability.
Here's a good example of an algo for force-based positions: http://bl.ocks.org/MoritzStefaner/1377729
Closing this as it is not directly actionable and many of the ideas have been explored / ticketed out elsewhere.