diff --git a/scripts/.taginfo.js.swp b/scripts/.taginfo.js.swp deleted file mode 100644 index fbc4485fc..000000000 Binary files a/scripts/.taginfo.js.swp and /dev/null differ diff --git a/src/americana.js b/src/americana.js index ac0735b20..1a27f5ebc 100644 --- a/src/americana.js +++ b/src/americana.js @@ -69,11 +69,8 @@ americanaLayers.push( lyrRail.preservedTunnel.dashes(), lyrRail.preservedServiceTunnel.dashes(), - lyrRail.lightRailTunnel.dashes(), - lyrRail.lightRailServiceTunnel.dashes(), - - lyrRail.tramTunnel.dashes(), - lyrRail.tramServiceTunnel.dashes(), + lyrRail.lightRailTramTunnel.dashes(), + lyrRail.lightRailTramServiceTunnel.dashes(), lyrRail.funicularTunnel.dashes(), @@ -251,11 +248,8 @@ americanaLayers.push( lyrRail.preserved.dashes(), lyrRail.preservedService.dashes(), - lyrRail.lightRail.dashes(), - lyrRail.lightRailService.dashes(), - - lyrRail.tram.dashes(), - lyrRail.tramService.dashes(), + lyrRail.lightRailTram.dashes(), + lyrRail.lightRailTramService.dashes(), lyrRail.funicular.dashes(), @@ -360,11 +354,8 @@ var bridgeLayers = [ lyrRail.preservedBridge.dashes(), lyrRail.preservedServiceBridge.dashes(), - lyrRail.lightRailBridge.dashes(), - lyrRail.lightRailServiceBridge.dashes(), - - lyrRail.tramBridge.dashes(), - lyrRail.tramServiceBridge.dashes(), + lyrRail.lightRailTramBridge.dashes(), + lyrRail.lightRailTramServiceBridge.dashes(), lyrRail.funicularBridge.dashes(), diff --git a/src/layer/rail.js b/src/layer/rail.js index 8243d0b8d..ca595d0a2 100644 --- a/src/layer/rail.js +++ b/src/layer/rail.js @@ -279,32 +279,14 @@ class PreservedService extends Preserved { } } -class LightRail extends Railway { +class LightRailTram extends Railway { constructor() { super(); - this.constraints = ["all", ["==", "subclass", "light_rail"], isNotService]; - this.brunnel = "surface"; - - this.minZoom = 14; - this.dashWidthFactor = 2; - this.dashArray = [1, 6]; - } -} - -class LightRailService extends LightRail { - constructor() { - super(); - this.constraints = ["all", ["==", "subclass", "light_rail"], isService]; - - this.dashWidthFactor = 3; - this.dashArray = [1, 12]; - } -} - -class Tram extends Railway { - constructor() { - super(); - this.constraints = ["all", ["==", "subclass", "tram"], isNotService]; + this.constraints = [ + "all", + ["in", "subclass", "light_rail", "tram"], + isNotService, + ]; this.brunnel = "surface"; this.minZoom = 14; @@ -313,10 +295,14 @@ class Tram extends Railway { } } -class TramService extends Tram { +class LightRailTramService extends LightRailTram { constructor() { super(); - this.constraints = ["all", ["==", "subclass", "tram"], isService]; + this.constraints = [ + "all", + ["in", "subclass", "light_rail", "tram"], + isService, + ]; this.dashWidthFactor = 3; this.dashArray = [1, 12]; @@ -384,20 +370,6 @@ class PreservedServiceBridge extends PreservedService { } } -class LightRailBridge extends LightRail { - constructor() { - super(); - this.brunnel = "bridge"; - } -} - -class LightRailServiceBridge extends LightRailService { - constructor() { - super(); - this.brunnel = "bridge"; - } -} - class FunicularBridge extends Funicular { constructor() { super(); @@ -405,14 +377,14 @@ class FunicularBridge extends Funicular { } } -class TramBridge extends Tram { +class LightRailTramBridge extends LightRailTram { constructor() { super(); this.brunnel = "bridge"; } } -class TramServiceBridge extends TramService { +class LightRailTramServiceBridge extends LightRailTramService { constructor() { super(); this.brunnel = "bridge"; @@ -463,20 +435,6 @@ class PreservedServiceTunnel extends PreservedService { } } -class LightRailTunnel extends LightRail { - constructor() { - super(); - this.brunnel = "tunnel"; - } -} - -class LightRailServiceTunnel extends LightRailService { - constructor() { - super(); - this.brunnel = "tunnel"; - } -} - class FunicularTunnel extends Funicular { constructor() { super(); @@ -484,14 +442,14 @@ class FunicularTunnel extends Funicular { } } -class TramTunnel extends Tram { +class LightRailTramTunnel extends LightRailTram { constructor() { super(); this.brunnel = "tunnel"; } } -class TramServiceTunnel extends TramService { +class LightRailTramServiceTunnel extends LightRailTramService { constructor() { super(); this.brunnel = "tunnel"; @@ -526,21 +484,13 @@ export const preservedService = new PreservedService(); export const preservedServiceBridge = new PreservedServiceBridge(); export const preservedServiceTunnel = new PreservedServiceTunnel(); -export const lightRail = new LightRail(); -export const lightRailBridge = new LightRailBridge(); -export const lightRailTunnel = new LightRailTunnel(); - -export const lightRailService = new LightRailService(); -export const lightRailServiceBridge = new LightRailServiceBridge(); -export const lightRailServiceTunnel = new LightRailServiceTunnel(); - -export const tram = new Tram(); -export const tramBridge = new TramBridge(); -export const tramTunnel = new TramTunnel(); +export const lightRailTram = new LightRailTram(); +export const lightRailTramBridge = new LightRailTramBridge(); +export const lightRailTramTunnel = new LightRailTramTunnel(); -export const tramService = new TramService(); -export const tramServiceBridge = new TramServiceBridge(); -export const tramServiceTunnel = new TramServiceTunnel(); +export const lightRailTramService = new LightRailTramService(); +export const lightRailTramServiceBridge = new LightRailTramServiceBridge(); +export const lightRailTramServiceTunnel = new LightRailTramServiceTunnel(); export const funicular = new Funicular(); export const funicularBridge = new FunicularBridge();