Skip to content

Commit

Permalink
Add rendering for straits mapped as linear ways (#3733)
Browse files Browse the repository at this point in the history
* Add rendering for straits on linear ways

* Change initial zoom level to z13 for straits as ways and nodes

Also text size is changed to 10pt at z13 and 12pt at >=z14 for ways and nodes tagged as straits

* Change initial zoom level to z14 for natural=strait way & node

Also separated out CSS for natural=strait points so that zoom level could be set separate from polygons
  • Loading branch information
jeisenbe authored and imagico committed Apr 15, 2019
1 parent 008f155 commit b117a29
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2142,13 +2142,15 @@ Layer:
waterway,
lock,
name,
"natural",
tags-> 'lock_name' AS lock_name,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi')
WHERE (waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi')
OR "natural" = 'strait')
AND (tunnel IS NULL or tunnel != 'culvert')
AND name IS NOT NULL
ORDER BY COALESCE(layer,0)
Expand Down
34 changes: 34 additions & 0 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,23 @@
}
}
}
[natural = 'strait'][zoom >= 14] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-fill: @water-text;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-max-char-angle-delta: 15;
text-spacing: 400;
text-placement: line;
[zoom >= 15] {
text-size: 12;
}
}
}


.text-low-zoom[zoom < 10],
#text-point[zoom >= 10] {
[feature = 'natural_water'],
Expand Down Expand Up @@ -353,3 +368,22 @@
}
}
}

#text-point[zoom >= 14] {
[feature = 'natural_strait'] {
text-name: "[name]";
text-size: 10;
text-wrap-width: 25; // 2.5 em
text-line-spacing: -1.5; // -0.15 em
text-fill: @water-text;
text-face-name: @oblique-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: point;
[zoom >= 15] {
text-size: 12;
text-wrap-width: 37; // 3.1 em
text-line-spacing: -1.6; // -0.13 em
}
}
}

0 comments on commit b117a29

Please sign in to comment.