-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support for highway=track #717
Draft
adamfranco
wants to merge
14
commits into
main
Choose a base branch
from
tracks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
47174eb
Add initial support for tracks as double-track dashed lines.
adamfranco cab046c
Change min-zoom for tracks to reflect earliest entry into OMT.
adamfranco 3cde280
Extend dashes to better match US FS topo style.
adamfranco 4e98493
Add solid double-track rendering for paved tracks.
adamfranco 3d8a28b
Add track names to the transportation-labels layer.
adamfranco d9222d7
Merge branch 'main' into tracks
adamfranco dbc6700
Tweak track widths to better match minor road widths at all zooms.
adamfranco c5895ae
Add basic bridge support.
adamfranco abe2c7c
Make fords water-line colored.
adamfranco 530ac4c
Prettier coding style fixes.
adamfranco ab1e133
Add taginfo for ford and track surface.
adamfranco 15a832e
Shorten legend names.
adamfranco 77c1a22
Merge branch 'main' into tracks
wmisener 5b3ba34
Update transportation_label.js
wmisener File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,13 @@ | |
"description": "Unpaved roads have an alternating dash pattern.", | ||
"doc_url": "https://openmaptiles.org/schema/#surface" | ||
}, | ||
{ | ||
"key": "surface", | ||
"value": "track", | ||
"object_types": ["way"], | ||
"description": "Track roads have a two-track line pattern that is dashed if unpaved and solid if paved.", | ||
"doc_url": "https://openmaptiles.org/schema/#transportation" | ||
}, | ||
{ | ||
"key": "iata", | ||
"object_types": ["node", "area"], | ||
|
@@ -388,6 +395,20 @@ | |
"description": "Major roads under construction have a dotted line pattern and a more prominent color.", | ||
"doc_url": "https://openmaptiles.org/schema/#transportation" | ||
}, | ||
{ | ||
"key": "highway", | ||
"value": "track", | ||
"object_types": ["way"], | ||
"description": "Track roads have a two-track line pattern that is dashed if unpaved and solid if paved.", | ||
"doc_url": "https://openmaptiles.org/schema/#transportation" | ||
}, | ||
{ | ||
"key": "ford", | ||
"value": "yes", | ||
"object_types": ["way"], | ||
"description": "The color of track roads changes from brown to blue for ways tagged as fords.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A more direct way of saying this is that the ford blends in with the waterway it crosses. |
||
"doc_url": "https://openmaptiles.org/schema/#transportation" | ||
}, | ||
{ | ||
"key": "railway", | ||
"value": "rail", | ||
|
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
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,147 @@ | ||
"use strict"; | ||
|
||
import * as Color from "../constants/color.js"; | ||
|
||
const trackSelect = ["==", ["get", "class"], "track"]; | ||
const unpavedSelect = ["!=", ["get", "surface"], "paved"]; | ||
const pavedSelect = ["==", ["get", "surface"], "paved"]; | ||
const bridgeSelect = ["==", ["get", "brunnel"], "bridge"]; | ||
const fordSelect = ["==", ["get", "brunnel"], "ford"]; | ||
const notFordSelect = ["!=", ["get", "brunnel"], "ford"]; | ||
const opacity = ["interpolate", ["exponential", 1.2], ["zoom"], 12, 0, 13, 1]; | ||
const getBrunnel = ["get", "brunnel"]; | ||
|
||
export const track = { | ||
id: "highway-track", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", trackSelect, unpavedSelect], | ||
minzoom: 12, | ||
paint: { | ||
"line-color": ["match", getBrunnel, "ford", Color.waterLine, "#d4b791"], | ||
"line-opacity": opacity, | ||
"line-blur": 0.75, | ||
"line-width": 0.5, | ||
"line-dasharray": [12, 3], | ||
"line-offset": 0, | ||
"line-gap-width": [ | ||
"interpolate", | ||
["exponential", 1.2], | ||
["zoom"], | ||
13, | ||
0.7, | ||
20, | ||
6, | ||
], | ||
}, | ||
}; | ||
|
||
export const pavedTrack = { | ||
id: "highway-track-paved", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", trackSelect, pavedSelect], | ||
minzoom: 12, | ||
paint: { ...track.paint }, | ||
}; | ||
pavedTrack["paint"]["line-dasharray"] = [1, 0]; | ||
|
||
export const trackBridge = { | ||
id: "highway-track-bridge", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", trackSelect, unpavedSelect, bridgeSelect], | ||
minzoom: 12, | ||
paint: { ...track.paint }, | ||
}; | ||
|
||
export const pavedTrackBridge = { | ||
id: "highway-track-paved-bridge", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", trackSelect, pavedSelect, bridgeSelect], | ||
minzoom: 12, | ||
paint: { ...pavedTrack.paint }, | ||
}; | ||
|
||
// Bridge casing layers | ||
export const bridgeCasing = { | ||
id: "track-bridge-casing", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", bridgeSelect, trackSelect], | ||
minzoom: 13, | ||
layout: { | ||
"line-cap": "butt", | ||
"line-join": "bevel", | ||
visibility: "visible", | ||
}, | ||
paint: { | ||
"line-color": "black", | ||
"line-opacity": opacity, | ||
"line-width": [ | ||
"interpolate", | ||
["exponential", 1.2], | ||
["zoom"], | ||
13, | ||
1.1, | ||
20, | ||
11, | ||
], | ||
}, | ||
}; | ||
// Bridge casing layers | ||
export const bridgeFill = { | ||
id: "track-bridge-fill", | ||
type: "line", | ||
source: "openmaptiles", | ||
"source-layer": "transportation", | ||
filter: ["all", bridgeSelect, trackSelect], | ||
minzoom: 13, | ||
layout: { | ||
"line-cap": "butt", | ||
"line-join": "bevel", | ||
visibility: "visible", | ||
}, | ||
paint: { | ||
"line-color": Color.backgroundFill, | ||
"line-opacity": opacity, | ||
"line-width": [ | ||
"interpolate", | ||
["exponential", 1.2], | ||
["zoom"], | ||
13, | ||
1.0, | ||
20, | ||
10, | ||
], | ||
}, | ||
}; | ||
|
||
export const legendEntries = [ | ||
{ | ||
description: "Unpaved track", | ||
layers: [track.id], | ||
filter: notFordSelect, | ||
}, | ||
{ | ||
description: "Unpaved track - ford", | ||
layers: [track.id], | ||
filter: fordSelect, | ||
}, | ||
{ | ||
description: "Paved track", | ||
layers: [pavedTrack.id], | ||
filter: notFordSelect, | ||
}, | ||
{ | ||
description: "Paved track - ford", | ||
layers: [pavedTrack.id], | ||
filter: fordSelect, | ||
}, | ||
]; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add an entry for
ford=yes
, as well as a second entry forsurface
that describes the stylistic variation on tracks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Added these taginfo entries in ab1e133.