From cbe6f7364ee5a4cd2b561ab4653deaaa51e94195 Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 7 Jul 2022 21:11:56 -0400 Subject: [PATCH 1/7] Add busways --- src/americana.js | 8 +++++++ src/layer/oneway.js | 9 +++---- src/layer/road.js | 53 +++++++++++++++++++++++++++++++++++++++++ src/layer/road_label.js | 11 +++++++++ 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/src/americana.js b/src/americana.js index 1a51f84e6..f612b7d2b 100644 --- a/src/americana.js +++ b/src/americana.js @@ -86,6 +86,7 @@ americanaLayers.push( lyrRoad.secondaryTunnel.casing(), lyrRoad.tertiaryExpresswayTunnel.casing(), lyrRoad.tertiaryTunnel.casing(), + lyrRoad.buswayTunnel.casing(), lyrRoad.minorTunnel.casing(), lyrRoad.serviceTunnel.casing(), lyrRoad.smallServiceTunnel.casing(), @@ -124,6 +125,7 @@ americanaLayers.push( lyrRoad.secondaryTunnel.fill(), lyrRoad.tertiaryExpresswayTunnel.fill(), lyrRoad.tertiaryTunnel.fill(), + lyrRoad.buswayTunnel.fill(), lyrRoad.minorTunnel.fill(), lyrRoad.serviceTunnel.fill(), lyrRoad.smallServiceTunnel.fill(), @@ -170,6 +172,7 @@ americanaLayers.push( lyrRoad.secondary.casing(), lyrRoad.tertiaryExpressway.casing(), lyrRoad.tertiary.casing(), + lyrRoad.busway.casing(), lyrRoad.minor.casing(), lyrRoad.service.casing(), lyrRoad.smallService.casing(), @@ -201,6 +204,7 @@ americanaLayers.push( lyrRoad.smallService.fill(), lyrRoad.service.fill(), + lyrRoad.busway.fill(), lyrRoad.minor.fill(), lyrRoad.tertiary.fill(), lyrRoad.tertiaryExpressway.fill(), @@ -240,6 +244,7 @@ americanaLayers.push( lyrRoad.smallService.surface(), lyrRoad.service.surface(), + lyrRoad.busway.surface(), lyrRoad.minor.surface(), lyrRoad.tertiary.surface(), lyrRoad.tertiaryExpressway.surface(), @@ -283,6 +288,7 @@ var bridgeLayers = [ lyrRoad.smallServiceBridge.casing(), lyrRoad.serviceBridge.casing(), lyrRoad.minorBridge.casing(), + lyrRoad.buswayBridge.casing(), lyrRoad.tertiaryBridge.casing(), lyrRoad.tertiaryExpresswayBridge.casing(), lyrRoad.secondaryBridge.casing(), @@ -321,6 +327,7 @@ var bridgeLayers = [ lyrRoad.smallServiceBridge.fill(), lyrRoad.serviceBridge.fill(), lyrRoad.minorBridge.fill(), + lyrRoad.buswayBridge.fill(), lyrRoad.tertiaryBridge.fill(), lyrRoad.tertiaryExpresswayBridge.fill(), lyrRoad.secondaryBridge.fill(), @@ -404,6 +411,7 @@ americanaLayers.push( lyrRoadLabel.primary, lyrRoadLabel.secondary, lyrRoadLabel.tertiary, + lyrRoadLabel.busway, lyrRoadLabel.minor, lyrRoadLabel.service, lyrRoadLabel.smallService, diff --git a/src/layer/oneway.js b/src/layer/oneway.js index ed1b598f0..fbe2b30cc 100644 --- a/src/layer/oneway.js +++ b/src/layer/oneway.js @@ -19,6 +19,7 @@ export const road = { // "primary", // "secondary", // "tertiary", + // "busway", // "minor", // "service", ], @@ -61,6 +62,7 @@ export const tunnel = { // "primary", // "secondary", // "tertiary", + // "busway", // "minor", // "service", ], @@ -104,6 +106,7 @@ export const bridge = { // "primary", // "secondary", // "tertiary", + // "busway", // "minor", // "service", ], @@ -146,8 +149,6 @@ export const link = { // "primary", // "secondary", // "tertiary", - // "minor", - // "service", ], ], layout: { @@ -188,8 +189,6 @@ export const tunnelLink = { // "primary", // "secondary", // "tertiary", - // "minor", - // "service", ], ], layout: { @@ -231,8 +230,6 @@ export const bridgeLink = { // "primary", // "secondary", // "tertiary", - // "minor", - // "service", ], ], layout: { diff --git a/src/layer/road.js b/src/layer/road.js index 27cb85e04..2f080e097 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -697,6 +697,39 @@ class TertiaryExpresswayToll extends TertiaryToll { } } +class Busway extends Road { + constructor() { + super(); + this.highwayClass = "busway"; + this.brunnel = "surface"; + this.link = false; + this.toll = false; + this.hue = 270; + + this.minZoomFill = 11; + this.minZoomCasing = 11; + + this.fillWidth = Util.zoomMultiply(trunkFillWidth, 0.5); + this.casingWidth = Util.zoomMultiply(trunkCasingWidth, 0.5); + + this.fillColor = [ + "interpolate", + ["exponential", roadExp], + ["zoom"], + this.minZoomFill, + `hsl(${this.hue}, 60%, 75%)`, + this.minZoomFill + 2, + `hsl(${this.hue}, 60%, 40%)`, + 14.9999, + `hsl(${this.hue}, 30%, 40%)`, + 15, + `hsl(${this.hue}, 30%, 75%)`, + ]; + this.casingColor = roadCasingColor(this.hue, this.minZoomCasing); + this.surfaceColor = `hsl(${this.hue}, 0%, 80%)`; + } +} + class Minor extends Road { constructor() { super(); @@ -1167,6 +1200,14 @@ class TertiaryExpresswayTollBridge extends TertiaryExpresswayToll { } } +class BuswayBridge extends Busway { + constructor() { + //undifferentiated + super(); + this.brunnel = "bridge"; + } +} + class MinorBridge extends Minor { constructor() { //undifferentiated @@ -1457,6 +1498,15 @@ class TertiaryExpresswayTollTunnel extends TertiaryExpresswayToll { } } +class BuswayTunnel extends Busway { + constructor() { + super(); + this.brunnel = "tunnel"; + this.casingColor = `hsl(${this.hue}, 0%, 80%)`; + this.fillColor = `hsl(${this.hue}, 30%, 95%)`; + } +} + class MinorTunnel extends Minor { constructor() { super(); @@ -1620,6 +1670,7 @@ export const tertiary = new Tertiary(); export const tertiaryToll = new TertiaryToll(); export const tertiaryExpressway = new TertiaryExpressway(); export const tertiaryExpresswayToll = new TertiaryExpresswayToll(); +export const busway = new Busway(); export const minor = new Minor(); export const minorToll = new MinorToll(); export const service = new Service(); @@ -1646,6 +1697,7 @@ export const tertiaryBridge = new TertiaryBridge(); export const tertiaryTollBridge = new TertiaryTollBridge(); export const tertiaryExpresswayBridge = new TertiaryExpresswayBridge(); export const tertiaryExpresswayTollBridge = new TertiaryExpresswayTollBridge(); +export const buswayBridge = new BuswayBridge(); export const minorBridge = new MinorBridge(); export const minorTollBridge = new MinorTollBridge(); export const serviceBridge = new ServiceBridge(); @@ -1672,6 +1724,7 @@ export const tertiaryTunnel = new TertiaryTunnel(); export const tertiaryTollTunnel = new TertiaryTollTunnel(); export const tertiaryExpresswayTunnel = new TertiaryExpresswayTunnel(); export const tertiaryExpresswayTollTunnel = new TertiaryExpresswayTollTunnel(); +export const buswayTunnel = new BuswayTunnel(); export const minorTunnel = new MinorTunnel(); export const minorTollTunnel = new MinorTollTunnel(); export const serviceTunnel = new ServiceTunnel(); diff --git a/src/layer/road_label.js b/src/layer/road_label.js index 078a3d02a..332d88ebe 100644 --- a/src/layer/road_label.js +++ b/src/layer/road_label.js @@ -91,6 +91,17 @@ export const tertiary = { "source-layer": "transportation_name", }; +export const busway = { + id: "busway_label", + type: "symbol", + paint: textPaint, + filter: ["all", ["==", "class", "busway"]], + minzoom: 13, + layout: Object.assign(zoomDependentLayout(17), textLayout), + source: "openmaptiles", + "source-layer": "transportation_name", +}; + export const minor = { id: "minor_label", type: "symbol", From 56a67a69754dd45b71eaaa5b4711a6bc13ec917e Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Fri, 8 Jul 2022 09:56:21 -0400 Subject: [PATCH 2/7] Change busways to dull gray --- src/layer/road.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/layer/road.js b/src/layer/road.js index 2f080e097..c43bcb989 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -704,10 +704,10 @@ class Busway extends Road { this.brunnel = "surface"; this.link = false; this.toll = false; - this.hue = 270; + this.hue = 0; - this.minZoomFill = 11; - this.minZoomCasing = 11; + this.minZoomFill = 12; + this.minZoomCasing = 12; this.fillWidth = Util.zoomMultiply(trunkFillWidth, 0.5); this.casingWidth = Util.zoomMultiply(trunkCasingWidth, 0.5); @@ -717,13 +717,13 @@ class Busway extends Road { ["exponential", roadExp], ["zoom"], this.minZoomFill, - `hsl(${this.hue}, 60%, 75%)`, + `hsl(${this.hue}, 0%, 85%)`, this.minZoomFill + 2, - `hsl(${this.hue}, 60%, 40%)`, + `hsl(${this.hue}, 0%, 75%)`, 14.9999, - `hsl(${this.hue}, 30%, 40%)`, + `hsl(${this.hue}, 0%, 75%)`, 15, - `hsl(${this.hue}, 30%, 75%)`, + `hsl(${this.hue}, 0%, 80%)`, ]; this.casingColor = roadCasingColor(this.hue, this.minZoomCasing); this.surfaceColor = `hsl(${this.hue}, 0%, 80%)`; @@ -1503,7 +1503,7 @@ class BuswayTunnel extends Busway { super(); this.brunnel = "tunnel"; this.casingColor = `hsl(${this.hue}, 0%, 80%)`; - this.fillColor = `hsl(${this.hue}, 30%, 95%)`; + this.fillColor = `hsl(${this.hue}, 0%, 95%)`; } } From c1a426b7734da93fd548b1cc7b54c46ea2dcc047 Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 6 Apr 2023 10:50:08 -0400 Subject: [PATCH 3/7] change busways to mauve --- src/layer/road.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/layer/road.js b/src/layer/road.js index 6879124a5..de4398220 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -19,6 +19,7 @@ const roadExp = 1.2; const roadHue = 0; const tollRoadHue = 48; +const buswayHue = 322; //Tunnel casing dash pattern const tunDashArray = [ @@ -287,6 +288,8 @@ const roadFillColorTunnel = [ `hsl(${tollRoadHue}, 77%, 90%)`, `hsl(${roadHue}, 77%, 90%)`, ], + "busway", + `hsl(${buswayHue}, 25%, 93%)`, [ ...tollSelector, `hsl(${tollRoadHue}, 100%, 95%)`, @@ -885,13 +888,13 @@ class Busway extends Tertiary { ["exponential", roadExp], ["zoom"], this.minZoomFill, - `hsl(0, 0%, 85%)`, + `hsl(${buswayHue}, 25%, 85%)`, this.minZoomFill + 2, - `hsl(0, 0%, 75%)`, + `hsl(${buswayHue}, 25%, 75%)`, 14.9999, - `hsl(0, 0%, 75%)`, + `hsl(${buswayHue}, 25%, 75%)`, 15, - `hsl(0, 0%, 80%)`, + `hsl(${buswayHue}, 25%, 80%)`, ]; this.surfaceColor = `hsl(${this.hue}, 0%, 80%)`; } From 2fb1becf51d76b55f7ffe8c17ab81da1b76b59be Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 6 Apr 2023 11:57:10 -0400 Subject: [PATCH 4/7] add guided busways --- src/layer/road.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/layer/road.js b/src/layer/road.js index de4398220..33ed9e1e1 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -81,7 +81,15 @@ const opacity = [ minZoomTertiary, [ ...classSelector, - ["motorway", "trunk", "primary", "secondary", "tertiary", "busway"], + [ + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "busway", + "bus_guideway", + ], 1, 0, ], @@ -124,6 +132,7 @@ function filterRoad(brunnel, constraints) { "secondary", "tertiary", "busway", + "bus_guideway", "minor", "service", ], @@ -181,7 +190,7 @@ const widthFactor = [ [...linkSelector, 0.45, 0.9], "secondary", [...linkSelector, 0.3, [...expresswaySelector, 0.7, 0.6]], - ["tertiary", "busway"], + ["tertiary", "busway", "bus_guideway"], [...linkSelector, 0.25, 0.5], "minor", 0.3, @@ -240,7 +249,7 @@ const roadCasingColorTunnel = [ ], `hsl(${roadHue}, 41%, 80%)`, ], - ["primary", "secondary", "tertiary", "busway"], + ["primary", "secondary", "tertiary", "busway", "bus_guideway"], "hsl(0, 0%, 80%)", "hsl(0, 0%, 90%)", ], @@ -288,7 +297,7 @@ const roadFillColorTunnel = [ `hsl(${tollRoadHue}, 77%, 90%)`, `hsl(${roadHue}, 77%, 90%)`, ], - "busway", + ["busway", "bus_guideway"], `hsl(${buswayHue}, 25%, 93%)`, [ ...tollSelector, @@ -531,7 +540,10 @@ class RoadSimpleFill extends Road { [ "in", getClass, - ["literal", ["primary", "secondary", "tertiary", "busway"]], + [ + "literal", + ["primary", "secondary", "tertiary", "busway", "bus_guideway"], + ], ], isExpressway, ], @@ -878,7 +890,11 @@ class TertiaryExpressway extends Tertiary { class Busway extends Tertiary { constructor() { super(); - this.constraints = ["==", getClass, "busway"]; + this.constraints = [ + "in", + getClass, + ["literal", ["busway", "bus_guideway"]], + ]; this.minZoomFill = minZoomTertiary; this.minZoomCasing = minZoomTertiary; From 034b9cee141dc68b0478f09b53362d4d1317ef2d Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 6 Apr 2023 18:27:26 -0400 Subject: [PATCH 5/7] desaturate low-zoom busways --- src/layer/road.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layer/road.js b/src/layer/road.js index 33ed9e1e1..07e494751 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -904,11 +904,11 @@ class Busway extends Tertiary { ["exponential", roadExp], ["zoom"], this.minZoomFill, - `hsl(${buswayHue}, 25%, 85%)`, - this.minZoomFill + 2, `hsl(${buswayHue}, 25%, 75%)`, + this.minZoomFill + 2, + `hsl(${buswayHue}, 25%, 50%)`, 14.9999, - `hsl(${buswayHue}, 25%, 75%)`, + `hsl(${buswayHue}, 25%, 50%)`, 15, `hsl(${buswayHue}, 25%, 80%)`, ]; From 55b93b3d47921d41939ad3af5c5ff1697f59fa1c Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 6 Apr 2023 19:01:05 -0400 Subject: [PATCH 6/7] add busway legend entry --- src/layer/road.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/layer/road.js b/src/layer/road.js index 07e494751..5e98b1be8 100644 --- a/src/layer/road.js +++ b/src/layer/road.js @@ -1324,6 +1324,11 @@ export const legendEntries = [ ], filter: isToll, }, + { + description: "Busway", + layers: [busway.fill().id, roadSimpleCasing.casing().id], + filter: ["==", getClass, "busway"], + }, { description: "Unpaved road", layers: [ From 918cad64d883bc83735f40379198f4e33e53dbcf Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Thu, 6 Apr 2023 19:03:44 -0400 Subject: [PATCH 7/7] add busway taginfo description --- scripts/taginfo_template.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index d0363474c..824666cfb 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -553,6 +553,20 @@ "object_types": ["way"], "description": "🇮🇪 Roads belonging to non-primary routes are marked by a color-coded patch containing the ref=* tag.", "doc_url": "https://openmaptiles.org/schema/#network" + }, + { + "key": "highway", + "value": "busway", + "object_types": ["way"], + "description": "Busways are styled with a purple solid line.", + "doc_url": "https://openmaptiles.org/schema/#network" + }, + { + "key": "highway", + "value": "bus_guideway", + "object_types": ["way"], + "description": "Bus guideways are styled with a purple solid line.", + "doc_url": "https://openmaptiles.org/schema/#network" } ] }