Skip to content

Commit

Permalink
Merge pull request #2146 from gravitystorm/zoom-nesting-guidelines
Browse files Browse the repository at this point in the history
Add guideline on symbolizers which change per zoom
  • Loading branch information
pnorman committed Jun 7, 2016
2 parents 1b579f6 + 6b9ef3c commit 33b4611
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -94,6 +94,35 @@ instead of
* Order the selectors in a style-sheet in rough order of importance (i.e.,
`highway=primary`, then `highway=secondary`) and beyond that, add layers that
are rendered later (i.e., higher) lower in the file.
* For features where the symbolizer attributes change on different zoom levels,
the main definition should be for the lowest zoom level. Also, avoid nesting
zoom-based overrides. For example:

```
#layer[feature = 'foo'][zoom >= 13] {
line-width: 6;
line-color: black;
[zoom >= 15] {
line-width: 7;
}
[zoom >= 17] {
line-width: 10;
}
}
```
instead of
```
#layer[feature = 'foo'][zoom >= 13] {
line-width: 10;
line-color: black;
[zoom < 18] {
line-width: 7;
[zoom < 16] {
line-width: 6;
}
}
}
```

## SQL Style Guidelines
Because SQL within JSON or YAML will not generally be syntax highlighted, indentation and caps are particularly important.
Expand Down

0 comments on commit 33b4611

Please sign in to comment.