better train station rendering

Sat, 26 Sep 2020 01:30:17 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 26 Sep 2020 01:30:17 +0300
changeset 6
0575190fa5fc
parent 5
63cfc4b10f9c
child 7
be0aa4b6aac9

better train station rendering

project.mml file | annotate | diff | comparison | revisions
style/amenity.mss file | annotate | diff | comparison | revisions
style/roads.mss file | annotate | diff | comparison | revisions
--- a/project.mml	Sat Sep 26 00:55:58 2020 +0300
+++ b/project.mml	Sat Sep 26 01:30:17 2020 +0300
@@ -448,7 +448,9 @@
 					name,
 					bilingual_name,
 					railway,
-					tags->'railway:ref' AS ref
+					COALESCE(tags->'network', 'FI:local') AS network,
+					tags->'railway:ref' AS ref,
+					(CASE WHEN tags->'station' = 'subway' THEN 1 ELSE 0 END) AS subway
 					FROM planet_osm_point
 					WHERE "railway" IN ('station', 'halt')
 				) AS train_stations
--- a/style/amenity.mss	Sat Sep 26 00:55:58 2020 +0300
+++ b/style/amenity.mss	Sat Sep 26 01:30:17 2020 +0300
@@ -35,10 +35,26 @@
 
 #train-stations
 {
-	[zoom >= 12]
+	[zoom >= 9][zoom < 11][subway = 0][network = 'FI:national'],
+	[zoom >= 10][zoom < 12][subway = 0][network = 'FI:regional'],
+	[zoom >= 13][zoom < 15][subway = 1],
+	[zoom >= 13][zoom < 15][network = 'FI:local'],
+	{
+		marker-file: url('symbols/square.svg');
+		marker-fill: #354ba3;
+		[subway = 1]
+		{
+			marker-fill: #a36c35;
+		}
+		marker-width: 6;
+		marker-clip: false;
+	}
+	[zoom >= 11][subway = 0][network = 'FI:national'],
+	[zoom >= 12][subway = 0][network = 'FI:regional'],
+	[zoom >= 15]
 	{
 		text-name: "[ref]";
-		[zoom >= 14]
+		[zoom >= 13]
 		{
 			text-name: "[bilingual_name]";
 		}
@@ -54,7 +70,11 @@
 		[zoom >= 18] { text-size: 13; }
 		text-face-name: "FreeSans Bold";
 		text-halo-radius: 1.5 * @standard-halo-radius;
-		text-halo-fill: blue;
+		text-halo-fill: #354ba3;
+		[subway = 1]
+		{
+			text-halo-fill: #a36c35;
+		}
 		/*
 		[zoom >= 16]
 		{
@@ -84,8 +104,8 @@
 		[zoom >= 17] { text-size: 12; }
 		[zoom >= 18] { text-size: 13; }
 		text-face-name: "FreeSans Bold";
-		text-halo-radius: 0.75 * @standard-halo-radius;
-		text-halo-fill: @standard-halo-fill;
+		text-halo-radius: @standard-halo-radius;
+		text-halo-fill: white;
 	}
 }
 
@@ -105,8 +125,8 @@
 		[zoom >= 18] { text-size: 12; }
 		[zoom >= 19] { text-size: 13; }
 		text-face-name: "FreeSans Bold";
-		text-halo-radius: @standard-halo-radius;
-		text-halo-fill: @standard-halo-fill;
+		text-halo-radius: 1.25 * @standard-halo-radius;
+		text-halo-fill: white;
 	}
 }
 
--- a/style/roads.mss	Sat Sep 26 00:55:58 2020 +0300
+++ b/style/roads.mss	Sat Sep 26 01:30:17 2020 +0300
@@ -551,13 +551,13 @@
 {
 	shield-name: "[ref]";
 	shield-size: 12;
-	shield-fill: blue;
+	shield-fill: white;
+	shield-halo-fill: #354ba3;
 	shield-spacing: 300;
 	shield-clip: false;
 	shield-placement: line;
 	shield-face-name: @railway-fonts-bold;
 	shield-halo-radius: @standard-halo-radius * 2;
-	shield-halo-fill: white;
 	shield-file: url('empty.png');
 	shield-repeat-distance: 10;
 }

mercurial