server tile_style: add green spaces, tune min zoom levels

This commit is contained in:
Astro 2021-08-28 19:23:23 +02:00
parent 84dc2023ee
commit 1b23f8c71d
1 changed files with 23 additions and 9 deletions

View File

@ -48,22 +48,36 @@ const STYLES: &[(Selector, Style)] = &[
(Selector::HasTag("tunnel"),
Style { z_index: -10, ..Style::DEFAULT }),
(Selector::TagEquals("landuse", "forest"),
Style { z_index: -8, fill: Some((0.2, 0.7, 0.2, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("leisure", "park"),
Style { z_index: -8, fill: Some((0.3, 0.7, 0.3, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("landuse", "meadow"),
Style { z_index: -6, fill: Some((0.2, 0.8, 0.2, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("landuse", "grass"),
Style { z_index: -5, fill: Some((0.3, 0.9, 0.3, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("landuse", "industrial"),
Style { z_index: -9, fill: Some((0.3, 0.3, 0.2, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("landuse", "construction"),
Style { z_index: -9, fill: Some((0.5, 0.5, 0.3, 0.8)), ..Style::DEFAULT }),
(Selector::TagEquals("highway", "motorway"),
Style { z_index: 10, stroke: Some((60., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 10, stroke: Some((50., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::TagEquals("highway", "trunk"),
Style { z_index: 9, stroke: Some((40., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 9, stroke: Some((35., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::TagEquals("highway", "primary"),
Style { z_index: 8, stroke: Some((35., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 8, stroke: Some((25., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::TagEquals("highway", "secondary"), Selector::MinZoom(12)]),
Style { z_index: 7, stroke: Some((30., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 7, stroke: Some((20., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::TagEquals("highway", "tertiary"), Selector::MinZoom(14)]),
Style { z_index: 6, stroke: Some((20., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 6, stroke: Some((15., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::TagEquals("highway", "residential"), Selector::MinZoom(16)]),
Style { z_index: 5, stroke: Some((15., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 5, stroke: Some((10., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::TagEquals("highway", "living_street"), Selector::MinZoom(16)]),
Style { z_index: 4, stroke: Some((12., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 4, stroke: Some((8., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::HasTag("highway"), Selector::MinZoom(18)]),
Style { z_index: 3, stroke: Some((10., (1., 1., 1., 1.))), ..Style::DEFAULT }),
Style { z_index: 3, stroke: Some((6., (1., 1., 1., 1.))), ..Style::DEFAULT }),
(Selector::And(&[Selector::HasTag("railway"), Selector::MinZoom(10)]),
Style { z_index: 20, stroke: Some((3., (0., 0., 0., 1.))), ..Style::DEFAULT }),
@ -71,7 +85,7 @@ const STYLES: &[(Selector, Style)] = &[
(Selector::Or(&[Selector::HasTag("waterway"), Selector::TagEquals("natural", "water")]),
Style { z_index: -2, fill: Some((0.5, 0.5, 0.7, 1.)), ..Style::DEFAULT }),
(Selector::And(&[Selector::HasTag("building"), Selector::MinZoom(17)]),
(Selector::And(&[Selector::HasTag("building"), Selector::MinZoom(16)]),
Style { z_index: 30, fill: Some((0.7, 0.7, 0.7, 1.)), stroke: Some((1., (0., 0., 0., 1.))), ..Style::DEFAULT }),
];