forked from gravitystorm/openstreetmap-carto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gravitystorm#4666 from tjur0/feature/roller_coaster
feat: Render roller_coaster=track ✨🎢
- Loading branch information
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* For tourism features like roller coasters */ | ||
|
||
@track-casing: #707070; | ||
@track-fill: #ddd; | ||
|
||
/* The purpose of “roller-coaster-gap-fill” layer is to fill in the gaps between sections of roller coaster track. */ | ||
#roller-coaster-gap-fill[zoom >= 15] { | ||
::bridges { line-cap: round; } | ||
::casing { line-cap: round; } | ||
::fill { line-cap: round; } | ||
} | ||
|
||
#roller-coaster, #roller-coaster-gap-fill { | ||
[zoom >= 15] { | ||
::bridges[bridge = 'yes'][zoom >= 16] { | ||
line-width: 2.5 + @bridge-casing-width-z16; | ||
line-color: #000; | ||
line-join: round; | ||
|
||
[tunnel = 'yes'] { line-color: lighten(#000, 20%); } | ||
|
||
[zoom >= 17] { line-width: 4 + @bridge-casing-width-z17; } | ||
[zoom >= 18] { line-width: 6 + 1.5 * @bridge-casing-width-z18; } | ||
[zoom >= 19] { line-width: 8 + 2 * @bridge-casing-width-z19; } | ||
[zoom >= 20] { line-width: 12 + 2 * @bridge-casing-width-z20; } | ||
} | ||
|
||
::casing { | ||
line-width: 1; | ||
line-color: mix(@track-casing, @track-fill, 50%); | ||
line-join: round; | ||
|
||
[tunnel = 'yes'][zoom >= 16] { | ||
line-color: lighten(@track-casing, 20%); | ||
} | ||
[zoom >= 16] { | ||
line-color: @track-casing; | ||
line-width: 2.5; | ||
} | ||
[zoom >= 17] { line-width: 4; } | ||
[zoom >= 18] { line-width: 6; } | ||
[zoom >= 19] { line-width: 8; } | ||
[zoom >= 20] { line-width: 12; } | ||
} | ||
|
||
::fill[zoom >= 16] { | ||
line-width: 1.25; | ||
line-color: @track-fill; | ||
line-join: round; | ||
|
||
[tunnel = 'yes'] { | ||
line-color: lighten(@track-fill, 5%); | ||
} | ||
[zoom >= 17] { line-width: 2; } | ||
[zoom >= 18] { line-width: 3; } | ||
[zoom >= 19] { line-width: 4; } | ||
[zoom >= 20] { line-width: 6; } | ||
} | ||
} | ||
} | ||
|
||
#roller-coaster::fill[zoom >= 16] { | ||
line-dasharray: 2.5,0.5; | ||
[zoom >= 17] { line-dasharray: 4,0.8; } | ||
[zoom >= 18] { line-dasharray: 6,1.2; } | ||
[zoom >= 19] { line-dasharray: 8,1.6; } | ||
[zoom >= 20] { line-dasharray: 12,2.4; } | ||
} |