Skip to content

Commit

Permalink
Merge pull request #2593 from nebulon42/construction-names
Browse files Browse the repository at this point in the history
use parameters of road type for text rendering of roads under construction
  • Loading branch information
nebulon42 authored Apr 7, 2017
2 parents 84bc87c + 702fcb5 commit c8adc98
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
2 changes: 1 addition & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,7 @@ Layer:
way,
CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END,
CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel,
CASE WHEN construction IN ('service', 'footway', 'cycleway', 'bridleway', 'path', 'track') THEN 'yes' ELSE 'no' END AS int_construction_minor,
construction,
name,
CASE
WHEN oneway IN ('yes', '-1') THEN oneway
Expand Down
60 changes: 36 additions & 24 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
#roads-text-name {
[highway = 'motorway'],
[highway = 'trunk'],
[highway = 'primary'] {
[highway = 'primary'],
[highway = 'construction'][construction = 'motorway'],
[highway = 'construction'][construction = 'trunk'],
[highway = 'construction'][construction = 'primary'] {
[zoom >= 13] {
text-name: "[name]";
text-size: 8;
Expand Down Expand Up @@ -2790,7 +2793,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-size: 12;
}
}
[highway = 'secondary'] {
[highway = 'secondary'],
[highway = 'construction'][construction = 'secondary'] {
[zoom >= 13] {
text-name: "[name]";
text-size: 8;
Expand All @@ -2815,7 +2819,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-size: 12;
}
}
[highway = 'tertiary'] {
[highway = 'tertiary'],
[highway = 'construction'][construction = 'tertiary'] {
[zoom >= 14] {
text-name: "[name]";
text-size: 9;
Expand All @@ -2834,29 +2839,32 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-size: 12;
}
}
[highway = 'construction'] {
[int_construction_minor = 'no'][zoom >= 13],
[int_construction_minor = 'yes'][zoom >= 14] {
text-name: "[name]";
text-size: 9;
text-fill: black;
text-spacing: 300;
text-clip: false;
text-placement: line;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-face-name: @book-fonts;
[zoom >= 17] {
text-size: 11;
}
[zoom >= 19] {
text-size: 12;
}
[highway = 'construction'][construction = null][zoom >= 16] {
text-name: "[name]";
text-size: 9;
text-fill: black;
text-spacing: 300;
text-clip: false;
text-placement: line;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-face-name: @book-fonts;

[zoom >= 17] {
text-size: 11;
text-spacing: 400;
}
[zoom >= 19] {
text-size: 12;
text-spacing: 400;
}
}
[highway = 'residential'],
[highway = 'unclassified'],
[highway = 'road'] {
[highway = 'road'],
[highway = 'construction'][construction = 'residential'],
[highway = 'construction'][construction = 'unclassified'],
[highway = 'construction'][construction = 'road'] {
[zoom >= 15] {
text-name: "[name]";
text-size: 8;
Expand All @@ -2882,7 +2890,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}

[highway = 'raceway'],
[highway = 'service'] {
[highway = 'service'],
[highway = 'construction'][construction = 'raceway'],
[highway = 'construction'][construction = 'service'] {
[zoom >= 16] {
text-name: "[name]";
text-size: 9;
Expand All @@ -2901,7 +2911,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}

[highway = 'living_street'],
[highway = 'pedestrian'] {
[highway = 'pedestrian'],
[highway = 'construction'][construction = 'living_street'],
[highway = 'construction'][construction = 'pedestrian'] {
[zoom >= 15] {
text-name: "[name]";
text-size: 8;
Expand Down

0 comments on commit c8adc98

Please sign in to comment.