From 1b23f8c71d6f571c132266c38e0b06152e0706de Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 28 Aug 2021 19:23:23 +0200 Subject: [PATCH] server tile_style: add green spaces, tune min zoom levels --- server/src/tile_style.rs | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/server/src/tile_style.rs b/server/src/tile_style.rs index b700416..a73b9b0 100644 --- a/server/src/tile_style.rs +++ b/server/src/tile_style.rs @@ -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 }), ];