MBStyle: improve label priority fidelity

Description

When multiple Mapbox Style layers refer to the same source, GeoTools will render them as one. This causes labels to be painted in the order they come from the data source, while Mapbox Styles GL is rendering them by the layer, starting with the topmost layer, and going backwards (top-most layer labels first).
This is used heavily to priority label rendering, for example, to make sure state labels are always shown, then major cities, then less important cities, and so on, by placing them in 3 different layers.

Given the Mapbox does not have a concept of cross-layer sorting/priority, its behavior can be mimicked by giving an explicit priority to labels, based on the order of the layers (all labels from the same layer get the same priority, which allows in the future to translate the in-layer sorting properties too).

Environment

None

Assignee

Andrea Aime

Reporter

Andrea Aime

Triage

None

Components

Fix versions

Priority

Medium
Configure