Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement track style changes from #136 #447

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 115 additions & 39 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
@cycleway-fill: blue;
@bridleway-fill: green;
@track-fill: #996600;
@track-grade1-fill: #b37700;
@track-grade2-fill: #a87000;
@aeroway-fill: #bbc;
@runway-fill: @aeroway-fill;
@taxiway-fill: @aeroway-fill;
Expand Down Expand Up @@ -567,12 +565,24 @@

[feature = 'highway_track'] {
.bridges-casing {
[zoom >= 14] {
line-width: 4.5;
line-color: @bridge-casing;
line-join: round;
[zoom >= 13] {
bridgecase/line-color: @bridge-casing;
bridgecase/line-join: round;
bridgecase/line-width: 4.4;
[tracktype = 'grade1'] {
line-width: 5;
bridgecase/line-width: 5.2;
}
[tracktype = 'grade2'] {
bridgecase/line-width: 4.8;
}
}
[zoom >= 15] {
bridgecase/line-width: 5;
[tracktype = 'grade1'] {
bridgecase/line-width: 6;
}
[tracktype = 'grade2'] {
bridgecase/line-width: 5.5;
}
}
}
Expand Down Expand Up @@ -718,13 +728,27 @@
}

[feature = 'highway_track'] {
/* We don't set opacity here, so it's 1.0. Aside from that, it's basically a copy of roads-fill::background in the track part of ::fill */
.bridges-casing {
[zoom >= 14] {
line-width: 3;
line-color: @track-casing;
line-join: round;
line-cap: round;
[tracktype = 'grade1'] { line-width: 3.5; }
[zoom >= 13] {
background/line-color: @track-casing;
background/line-join: round;
background/line-width: 2.4;
[tracktype = 'grade1'] {
background/line-width: 3.2;
}
[tracktype = 'grade2'] {
background/line-width: 2.8;
}
}
[zoom >= 15] {
background/line-width: 3;
[tracktype = 'grade1'] {
background/line-width: 4;
}
[tracktype = 'grade2'] {
background/line-width: 3.5;
}
}
}
}
Expand Down Expand Up @@ -1475,50 +1499,102 @@
}

[feature = 'highway_track'] {
comp-op: src-over; // to force flattering first
[zoom >= 13] {
.tunnels-fill[zoom >= 14] {
tunnelcasing/line-width: 4.5;
.tunnels-fill {
tunnelcasing/line-color: @tunnel-casing;
tunnelcasing/line-dasharray: 4,2;
tunnelcasing/line-width: 4.4;
[tracktype = 'grade1'] {
tunnelcasing/line-width: 5.2;
}
[tracktype = 'grade2'] {
tunnelcasing/line-width: 5.2;
}
[zoom >= 15]{
tunnelcasing/line-width: 5;
[tracktype = 'grade1'] {
tunnelcasing/line-width: 6;
}
[tracktype = 'grade2'] {
tunnelcasing/line-width: 5.5;
}
}
}

.roads-fill, .tunnels-fill {
[zoom >= 13] { background/line-width: 2.5; }
[zoom >= 14] { background/line-width: 3; }
.roads-fill { background/line-opacity: 0.4; }
/* The white casing that you mainly see against forests and other dark features */
.roads-fill::background, .tunnels-fill::background {
opacity: 0.4;
.tunnels-fill { opacity: 0.8; } // Tunnels are against a dark background, so make the fill stronger
background/line-color: @track-casing;
background/line-join: round;
background/line-cap: round;
background/line-width: 2.4;
/* With the heavier dasharrays on grade1 and grade2 it helps to make the casing a bit larger */
[tracktype = 'grade1'] {
background/line-width: 3.2;
}
[tracktype = 'grade2'] {
background/line-width: 2.8;
}

[zoom >= 15] {
background/line-width: 3;
[tracktype = 'grade1'] {
background/line-width: 4;
}
[tracktype = 'grade2'] {
background/line-width: 3.5;
}
}
}

line/line-color: @track-fill;
line/line-dasharray: 3,4;
line/line-cap: round;
line/line-join: round;
[zoom >= 13] { line/line-width: 1.2; }
[zoom >= 14] { line/line-width: 1.5; }
.roads-fill, .bridges-fill { line/line-opacity: 0.8; }
.tunnels-fill[zoom >= 14] { line/line-opacity: 0.5; }
/* Set the properties of the brown inside */
::line {
opacity: 0.8;
line/line-color: @track-fill;
line/line-dasharray: 5,4,2,4;
line/line-cap: round;
line/line-join: round;
line/line-opacity: 0.8;
line/line-clip:false;

/* ~80% of higher zoom sizes */
line/line-width: 1.2;

[zoom >= 14] {
[tracktype = 'grade1'] {
.roads-fill, .tunnels-fill { background/line-width: 3.5; }
line/line-width: 2;
line/line-color: @track-grade1-fill;
line/line-dasharray: 100,0; /* i.e. none, see https://github.com/mapbox/carto/issues/214 */
.roads-fill, .bridges-fill { line/line-opacity: 0.7; }
line/line-dasharray: 100,0;
}
[tracktype = 'grade2'] {
line/line-color: @track-grade2-fill;
line/line-dasharray: 9,4;
line/line-dasharray: 8.8,3.2;
}
[tracktype = 'grade3'] {
line/line-dasharray: 5.6,4.0;
}
[tracktype = 'grade4'] {
line/line-width: 2;
line/line-dasharray: 4,7,1,5;
line/line-dasharray: 3.2,4.8;
}
[tracktype = 'grade5'] {
line/line-width: 2;
line/line-dasharray: 1,5;
line/line-dasharray: 1.6,6.4;
}

[zoom >= 15] {
line/line-width: 1.5;
[tracktype = 'grade1'] {
line/line-dasharray: 100,0;
}
[tracktype = 'grade2'] {
line/line-dasharray: 11,4;
}
[tracktype = 'grade3'] {
line/line-dasharray: 7,5;
}
[tracktype = 'grade4'] {
line/line-dasharray: 4,6;
}
[tracktype = 'grade5'] {
line/line-dasharray: 2,8;
}
}
}
}
Expand Down