Created
June 22, 2013 13:54
-
-
Save stevage/5840947 to your computer and use it in GitHub Desktop.
Proposed text for TileMill/carto's documentation on layer application.
This file contains 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
The order in which objects are drawn depends on the following process. Each step in the process overrules steps with higher numbers. | |
1. Layers. "Higher" layers obscure "lower" ones. | |
2. Stylesheets. Stylesheets are applied from left to right. | |
3. Rules within a stylesheet. Rules are applied from top to bottom. This means two things: | |
a. objects defined by later rules will be drawn over those defined by later rules; and | |
b. attachments may be redefined by later rules. | |
4. Attachments (eg, `::glow { ... }`) within a rule are applied from top to bottom. (The order of different symbolizers within an attachment doesn't matter.) | |
5. Lastly, all else being equal, objects are drawn in the order in which they are found, such as in PostGIS. | |
The process of avoiding collisions between text symbolizers (labels) is the same, but the result can be counterintuitive. This only applies to symbolizers with `text-placement: simple;`. When rules are applied, labels claim space that will be avoided by later rules. This means that, for example, a label defined by a rule in a layer may prevent a label in a "higher" layer being drawn, even though it is drawn "beneath" it. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice work. added a revised version in https://github.com/mapbox/tilemill/commit/f70dc7b7730ea71aefa2461940ba561104f42219.
The order of different symbolizers within an attachment doesn't matter
is not a true generally so I removed that. I also removedThis only applies to symbolizers with
text-placement: simple;`` which I felt was slightly confusing, but I agree that this issue of how labels greedily take space needs better treatment, perhaps in a separate dedicated section?