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/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",