Skip to content

Commit 728032e

Browse files
jragusaimagico
authored andcommitted
Unify code of power=tower and power=pole (gravitystorm#3561)
* unify code of power=tower and power=pole * invert pole and tower * add ORDER condition * fix ORDER BY
1 parent 816f726 commit 728032e

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

power.mss

+13-14
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,20 @@
3333
}
3434

3535
#power-towers {
36-
[zoom >= 14] {
37-
marker-file: url('symbols/man_made/power_tower_small.svg');
38-
marker-width: 3;
39-
}
40-
[zoom >= 15] {
41-
marker-file: url('symbols/man_made/power_tower.svg');
42-
marker-width: 5;
43-
}
44-
[zoom >= 17] {
45-
marker-width: 7;
36+
[power = 'tower'] {
37+
[zoom >= 14] {
38+
marker-file: url('symbols/man_made/power_tower_small.svg');
39+
marker-width: 3;
40+
}
41+
[zoom >= 15] {
42+
marker-file: url('symbols/man_made/power_tower.svg');
43+
marker-width: 5;
44+
}
45+
[zoom >= 17] {
46+
marker-width: 7;
47+
}
4648
}
47-
}
48-
49-
#power-poles {
50-
[zoom >= 16] {
49+
[power = 'pole'][zoom >= 16] {
5150
marker-file: url('symbols/square.svg');
5251
marker-fill: #928f8f;
5352
marker-width: 3;

project.mml

+10-16
Original file line numberDiff line numberDiff line change
@@ -1707,25 +1707,19 @@ Layer:
17071707
<<: *osm2pgsql
17081708
table: |-
17091709
(SELECT
1710-
way
1711-
FROM planet_osm_point
1712-
WHERE power = 'tower'
1710+
way,
1711+
power
1712+
FROM planet_osm_point
1713+
WHERE power IN ('tower', 'pole')
1714+
ORDER BY
1715+
CASE
1716+
WHEN power = 'tower' THEN 1
1717+
WHEN power = 'pole' THEN 2
1718+
ELSE NULL
1719+
END
17131720
) AS power_towers
17141721
properties:
17151722
minzoom: 14
1716-
- id: power-poles
1717-
geometry: point
1718-
<<: *extents
1719-
Datasource:
1720-
<<: *osm2pgsql
1721-
table: |-
1722-
(SELECT
1723-
way
1724-
FROM planet_osm_point
1725-
WHERE power = 'pole'
1726-
) AS power_poles
1727-
properties:
1728-
minzoom: 16
17291723
- id: roads-text-ref-low-zoom
17301724
geometry: linestring
17311725
<<: *extents

0 commit comments

Comments
 (0)