From 73598d19e61009ffa99c94dc9657334a2e0ae51c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 18 May 2024 20:24:22 -0400 Subject: [PATCH 01/44] Implement banner maps --- shieldlib/src/shield_renderer.ts | 20 +++++++++++++++ shieldlib/src/types.ts | 4 +++ src/js/shield_defs.js | 44 ++++++++++---------------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/shieldlib/src/shield_renderer.ts b/shieldlib/src/shield_renderer.ts index 87f72cb55..a83c8c92e 100644 --- a/shieldlib/src/shield_renderer.ts +++ b/shieldlib/src/shield_renderer.ts @@ -11,6 +11,7 @@ import { RouteDefinition, RouteParser, ShapeBlankParams, + ShieldDefinition, ShieldDefinitions, ShieldOptions, ShieldSpecification, @@ -104,6 +105,25 @@ export class AbstractShieldRenderer { /** Specify which shields to draw and with what graphics */ protected setShields(shieldSpec: ShieldSpecification) { this._renderContext.options = shieldSpec.options; + + // Unpack any banner maps and compose them as separate network entries in-memory + for (const [key, shieldDef] of Object.entries(shieldSpec.networks)) { + if (!shieldDef) { + continue; // Skip if shieldDef is null or undefined + } + + // Check to see if it has a bannerMap + if (shieldDef.bannerMap) { + // If it does, loop through each entry in the bannerMap + for (const [bannerKey, banners] of Object.entries(shieldDef.bannerMap)) { + // Make a copy of the ShieldDefinition and attach the banners + const banneredShieldDef: ShieldDefinition = { ...shieldDef, banners: banners }; + // Insert this modified ShieldDefinition into the global network list + shieldSpec.networks[bannerKey] = banneredShieldDef; + } + } + } + this._renderContext.shieldDef = shieldSpec.networks; this._fontSpec = "1em " + shieldSpec.options.shieldFont; console.log("ShieldJSON loaded"); diff --git a/shieldlib/src/types.ts b/shieldlib/src/types.ts index 593da3744..d54665aae 100644 --- a/shieldlib/src/types.ts +++ b/shieldlib/src/types.ts @@ -35,6 +35,10 @@ export interface ShieldDefinitionBase { textLayout?: TextLayout; /** Banners to be drawn above a shield */ banners?: string[]; + /** Map of additional networks that are bannered variants of this one */ + bannerMap?: { + [key: string]: string[]; + }; /** If true, no next should be drawn on this shield */ notext?: boolean; /** Maximum size of shield text */ diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 4cd44e443..1cbc94ce0 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -475,37 +475,19 @@ export function loadShields() { // US Highways shields["US:US"] = badgeShield; - - shields["US:US:Truck"] = banneredShield(shields["US:US"], ["TRK"]); - shields["US:US:Truck:Bypass"] = banneredShield(shields["US:US"], [ - "TRK", - "BYP", - ]); - - shields["US:US:Spur"] = banneredShield(shields["US:US"], ["SPUR"]); - - shields["US:US:Connector"] = banneredShield(shields["US:US"], ["CONN"]); - - shields["US:US:Bypass"] = banneredShield(shields["US:US"], ["BYP"]); - - shields["US:US:Future"] = banneredShield(shields["US:US"], ["FUT"]); - - shields["US:US:Business"] = banneredShield(shields["US:US"], ["BUS"]); - shields["US:US:Business:Alternate"] = banneredShield(shields["US:US"], [ - "BUS", - "ALT", - ]); - shields["US:US:Business:Truck"] = banneredShield(shields["US:US"], [ - "BUS", - "TRK", - ]); - - shields["US:US:Alternate"] = banneredShield(shields["US:US"], ["ALT"]); - shields["US:US:Alternate:Truck:Business"] = banneredShield(shields["US:US"], [ - "ALT", - "TRK", - "BUS", - ]); + shields["US:US"].bannerMap = { + "US:US:Truck": ["TRK"], + "US:US:Truck:Bypass": ["TRK", "BYP"], + "US:US:Spur": ["SPUR"], + "US:US:Connector": ["CONN"], + "US:US:Bypass": ["BYP"], + "US:US:Future": ["FUT"], + "US:US:Business": ["BUS"], + "US:US:Business:Alternate": ["BUS", "ALT"], + "US:US:Business:Truck": ["BUS", "TRK"], + "US:US:Alternate": ["ALT"], + "US:US:Alternate:Truck:Business": ["ALT", "TRK", "BUS"], + }; shields["US:US:Historic"] = banneredShield( { From 78c25dd713e3c656acbdd39013897dcbc5f5164c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 19 May 2024 19:03:20 -0400 Subject: [PATCH 02/44] Formatter --- shieldlib/src/shield_renderer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shieldlib/src/shield_renderer.ts b/shieldlib/src/shield_renderer.ts index a83c8c92e..626b7cabc 100644 --- a/shieldlib/src/shield_renderer.ts +++ b/shieldlib/src/shield_renderer.ts @@ -115,9 +115,14 @@ export class AbstractShieldRenderer { // Check to see if it has a bannerMap if (shieldDef.bannerMap) { // If it does, loop through each entry in the bannerMap - for (const [bannerKey, banners] of Object.entries(shieldDef.bannerMap)) { + for (const [bannerKey, banners] of Object.entries( + shieldDef.bannerMap + )) { // Make a copy of the ShieldDefinition and attach the banners - const banneredShieldDef: ShieldDefinition = { ...shieldDef, banners: banners }; + const banneredShieldDef: ShieldDefinition = { + ...shieldDef, + banners: banners, + }; // Insert this modified ShieldDefinition into the global network list shieldSpec.networks[bannerKey] = banneredShieldDef; } From 89bb74ea49491585b79324df1f591ffbb1fefc73 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 30 May 2024 09:24:06 -0400 Subject: [PATCH 03/44] Update shield_defs.js Collapse syntax on US:US network --- src/js/shield_defs.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 6512e7724..a3bcaeb1c 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -500,19 +500,21 @@ export function loadShields() { shields["US:I:Downtown:Spur"] = shields["US:I:Business:Spur"]; // US Highways - shields["US:US"] = badgeShield; - shields["US:US"].bannerMap = { - "US:US:Truck": ["TRK"], - "US:US:Truck:Bypass": ["TRK", "BYP"], - "US:US:Spur": ["SPUR"], - "US:US:Connector": ["CONN"], - "US:US:Bypass": ["BYP"], - "US:US:Future": ["FUT"], - "US:US:Business": ["BUS"], - "US:US:Business:Alternate": ["BUS", "ALT"], - "US:US:Business:Truck": ["BUS", "TRK"], - "US:US:Alternate": ["ALT"], - "US:US:Alternate:Truck:Business": ["ALT", "TRK", "BUS"], + shields["US:US"] = { + ...badgeShield, + bannerMap: { + "US:US:Truck": ["TRK"], + "US:US:Truck:Bypass": ["TRK", "BYP"], + "US:US:Spur": ["SPUR"], + "US:US:Connector": ["CONN"], + "US:US:Bypass": ["BYP"], + "US:US:Future": ["FUT"], + "US:US:Business": ["BUS"], + "US:US:Business:Alternate": ["BUS", "ALT"], + "US:US:Business:Truck": ["BUS", "TRK"], + "US:US:Alternate": ["ALT"], + "US:US:Alternate:Truck:Business": ["ALT", "TRK", "BUS"], + } }; shields["US:US:Historic"] = banneredShield( From f69ce5780cf16a68f0362ca0d1aac76ad902762e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 30 May 2024 10:12:02 -0400 Subject: [PATCH 04/44] Consolidate banners for US:I --- src/js/shield_defs.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index a3bcaeb1c..94f8bf18b 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -479,14 +479,15 @@ export function loadShields() { top: 6, bottom: 5, }, + bannerMap: { + "US:I:Alternate": ["ALT"], + "US:I:Future": ["FUT"], + "US:I:Truck": ["TRK"], + "US:I:Express": ["EXPR"], + "US:I:Express:Toll": ["EXPR"], + } }; - shields["US:I:Alternate"] = banneredShield(shields["US:I"], ["ALT"]); - shields["US:I:Future"] = banneredShield(shields["US:I"], ["FUT"]); - shields["US:I:Truck"] = banneredShield(shields["US:I"], ["TRK"]); - shields["US:I:Express"] = banneredShield(shields["US:I"], ["EXPR"]); - shields["US:I:Express:Toll"] = shields["US:I:Express"]; - shields["US:I:Business:Loop"] = { ...shields["US:I"], spriteBlank: [ From d02d86a0248af215e94ceaf94d92e89ff66fecc4 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 30 May 2024 10:36:36 -0400 Subject: [PATCH 05/44] Alabama truck routes --- src/js/shield_defs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 94f8bf18b..a260d5a39 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -608,8 +608,11 @@ export function loadShields() { top: 3, bottom: 6, }, + bannerMap: { + "US:AL:Truck": ["TRK"], + }, }; - shields["US:AL:Truck"] = banneredShield(shields["US:AL"], ["TRK"]); + [ "Autauga", "Baldwin", From 7118dfd3ffe6ea9354d33cac7ce1adee3e02395c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 30 May 2024 14:00:38 -0400 Subject: [PATCH 06/44] Add banners for US:AZ --- src/js/shield_defs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index a260d5a39..d95ef24d3 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -776,10 +776,13 @@ export function loadShields() { top: 3, bottom: 4, }, + bannerMap: { + "US:AZ:Spur": ["SPUR"], + "US:AZ:Loop": ["LOOP"], + "US:AZ:Business": ["BUS"], + }, }; - shields["US:AZ:Spur"] = banneredShield(shields["US:AZ"], ["SPUR"]); - shields["US:AZ:Loop"] = banneredShield(shields["US:AZ"], ["LOOP"]); - shields["US:AZ:Business"] = banneredShield(shields["US:AZ"], ["BUS"]); + ["Coconino", "Mohave", "Yavapai"].forEach( (county) => (shields[`US:AZ:${county}`] = pentagonUpShield( From 06c3e5e98d690b05524607cdc7cb9f6ad48f125e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 30 May 2024 15:40:43 -0400 Subject: [PATCH 07/44] Add banners for US:DE routes --- src/js/shield_defs.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index d95ef24d3..0cac46355 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -106,7 +106,7 @@ export function loadShields() { shields["GLCT"] = { notext: true, }; - shields["GLCT:Loop"] = banneredShield( + shields["GLCT:Loop"] = ( shields["GLCT"], ["LOOP"], Color.shields.brown @@ -245,7 +245,7 @@ export function loadShields() { colorLighten: Color.shields.white, colorDarken: Color.shields.blue, }; - shields["CA:ON:private_toll"] = banneredShield( + shields["CA:ON:private_toll"] = ( pillShield(Color.shields.white, Color.shields.blue, Color.shields.black), ["ETR"] ); @@ -332,7 +332,7 @@ export function loadShields() { Color.shields.black )) ); - shields["CA:ON:Hastings:Wollaston"] = banneredShield( + shields["CA:ON:Hastings:Wollaston"] = ( roundedRectShield(Color.shields.white, Color.shields.black), ["TWP"] ); @@ -346,19 +346,19 @@ export function loadShields() { ); ["North Dumfries", "Wilmot"].forEach( (township) => - (shields[`CA:ON:Waterloo:${township}`] = banneredShield( + (shields[`CA:ON:Waterloo:${township}`] = ( shields["CA:ON:Waterloo"], ["TWP"] )) ); ["Brant", "Durham", "Haldimand", "Norfolk"].forEach( (county) => - (shields[`CA:ON:${county}:Highway`] = banneredShield( + (shields[`CA:ON:${county}:Highway`] = ( shields[`CA:ON:${county}`], ["HWY"] )) ); - shields["CA:ON:Muskoka:West"] = banneredShield(shields["CA:ON:Muskoka"], [ + shields["CA:ON:Muskoka:West"] = (shields["CA:ON:Muskoka"], [ "WEST", ]); shields["CA:ON:Hamilton:Expressway"] = { @@ -518,7 +518,7 @@ export function loadShields() { } }; - shields["US:US:Historic"] = banneredShield( + shields["US:US:Historic"] = ( { ...badgeShieldCrossbar, textColor: Color.shields.brown, @@ -808,7 +808,7 @@ export function loadShields() { bottom: 4, }, }; - shields["US:CA:Business"] = banneredShield( + shields["US:CA:Business"] = ( shields["US:CA"], ["BUS"], Color.shields.green @@ -923,10 +923,14 @@ export function loadShields() { }; // Delaware - shields["US:DE"] = ovalShield(Color.shields.white, Color.shields.black); - shields["US:DE:Alternate"] = banneredShield(shields["US:DE"], ["ALT"]); - shields["US:DE:Business"] = banneredShield(shields["US:DE"], ["BUS"]); - shields["US:DE:Truck"] = banneredShield(shields["US:DE"], ["TRK"]); + shields["US:DE"] = { + ...ovalShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:DE:Alternate": ["ALT"], + "US:DE:Business": ["BUS"], + "US:DE:Truck": ["TRK"], + }, + }; // Florida shields["US:FL"] = { From b70aaf933fcf381c8856c2ce08a5a4861314c1fa Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 31 May 2024 08:26:58 -0400 Subject: [PATCH 08/44] code format --- src/js/shield_defs.js | 54 +++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 0cac46355..3bf50ca54 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -106,11 +106,7 @@ export function loadShields() { shields["GLCT"] = { notext: true, }; - shields["GLCT:Loop"] = ( - shields["GLCT"], - ["LOOP"], - Color.shields.brown - ); + shields["GLCT:Loop"] = (shields["GLCT"], ["LOOP"], Color.shields.brown); // Canada shields["CA:transcanada"] = { @@ -245,10 +241,9 @@ export function loadShields() { colorLighten: Color.shields.white, colorDarken: Color.shields.blue, }; - shields["CA:ON:private_toll"] = ( - pillShield(Color.shields.white, Color.shields.blue, Color.shields.black), - ["ETR"] - ); + shields["CA:ON:private_toll"] = + (pillShield(Color.shields.white, Color.shields.blue, Color.shields.black), + ["ETR"]); shields["CA:ON:secondary"] = trapezoidUpShield( 10, Color.shields.white, @@ -332,10 +327,8 @@ export function loadShields() { Color.shields.black )) ); - shields["CA:ON:Hastings:Wollaston"] = ( - roundedRectShield(Color.shields.white, Color.shields.black), - ["TWP"] - ); + shields["CA:ON:Hastings:Wollaston"] = + (roundedRectShield(Color.shields.white, Color.shields.black), ["TWP"]); shields["CA:ON:Waterloo:Wellesley"] = ovalShield( Color.shields.white, Color.shields.black @@ -346,21 +339,15 @@ export function loadShields() { ); ["North Dumfries", "Wilmot"].forEach( (township) => - (shields[`CA:ON:Waterloo:${township}`] = ( - shields["CA:ON:Waterloo"], - ["TWP"] - )) + (shields[`CA:ON:Waterloo:${township}`] = + (shields["CA:ON:Waterloo"], ["TWP"])) ); ["Brant", "Durham", "Haldimand", "Norfolk"].forEach( (county) => - (shields[`CA:ON:${county}:Highway`] = ( - shields[`CA:ON:${county}`], - ["HWY"] - )) + (shields[`CA:ON:${county}:Highway`] = + (shields[`CA:ON:${county}`], ["HWY"])) ); - shields["CA:ON:Muskoka:West"] = (shields["CA:ON:Muskoka"], [ - "WEST", - ]); + shields["CA:ON:Muskoka:West"] = (shields["CA:ON:Muskoka"], ["WEST"]); shields["CA:ON:Hamilton:Expressway"] = { notext: true, overrideByName: { @@ -485,7 +472,7 @@ export function loadShields() { "US:I:Truck": ["TRK"], "US:I:Express": ["EXPR"], "US:I:Express:Toll": ["EXPR"], - } + }, }; shields["US:I:Business:Loop"] = { @@ -515,18 +502,17 @@ export function loadShields() { "US:US:Business:Truck": ["BUS", "TRK"], "US:US:Alternate": ["ALT"], "US:US:Alternate:Truck:Business": ["ALT", "TRK", "BUS"], - } + }, }; - shields["US:US:Historic"] = ( - { + shields["US:US:Historic"] = + ({ ...badgeShieldCrossbar, textColor: Color.shields.brown, colorLighten: Color.shields.brown, }, ["HIST"], - Color.shields.brown - ); + Color.shields.brown); // US Federal Agencies @@ -808,11 +794,7 @@ export function loadShields() { bottom: 4, }, }; - shields["US:CA:Business"] = ( - shields["US:CA"], - ["BUS"], - Color.shields.green - ); + shields["US:CA:Business"] = (shields["US:CA"], ["BUS"], Color.shields.green); ["CR", "Sierra"].forEach( (county) => (shields[`US:CA:${county}`] = pentagonUpShield( @@ -928,7 +910,7 @@ export function loadShields() { bannerMap: { "US:DE:Alternate": ["ALT"], "US:DE:Business": ["BUS"], - "US:DE:Truck": ["TRK"], + "US:DE:Truck": ["TRK"], }, }; From 1dc541fe72f72a5564c77ea60c4932f6948c8d43 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 31 May 2024 22:50:53 -0400 Subject: [PATCH 09/44] FL truck route --- src/js/shield_defs.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 4e4d26956..543f97e54 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -940,13 +940,22 @@ export function loadShields() { spriteBlank: "shield_us_fl_turnpike", }, }; - shields["US:FL:CR"] = pentagonUpShield( - 3, - 15, - Color.shields.blue, - Color.shields.yellow - ); - shields["US:FL:CR:Truck"] = banneredShield(shields["US:FL:CR"], ["TRK"]); + + shields["US:DE"] = { + ...ovalShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:DE:Alternate": ["ALT"], + "US:DE:Business": ["BUS"], + "US:DE:Truck": ["TRK"], + }, + }; + + shields["US:FL:CR"] = { + ...pentagonUpShield(3, 15, Color.shields.blue, Color.shields.yellow), + bannerMap: { + "US:FL:CR:Truck": ["TRK"], + }, + }; // Georgia shields["US:GA"] = { From 8e7dc7aee64eb4d92362859a201ade8b622d2137 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 31 May 2024 22:53:06 -0400 Subject: [PATCH 10/44] Add Georgia banners --- src/js/shield_defs.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 543f97e54..2d581ec0c 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -967,17 +967,16 @@ export function loadShields() { top: 5, bottom: 4, }, + bannerMap: { + "US:GA:Truck:Bypass": ["TRK", "BYP"], + "US:GA:Spur": ["SPUR"], + "US:GA:Loop": ["LOOP"], + "US:GA:Connector": ["CONN"], + "US:GA:Bypass": ["BYP"], + "US:GA:Business": ["BUS"], + "US:GA:Alternate": ["ALT"], + }, }; - shields["US:GA:Truck:Bypass"] = banneredShield(shields["US:GA"], [ - "TRK", - "BYP", - ]); - shields["US:GA:Spur"] = banneredShield(shields["US:GA"], ["SPUR"]); - shields["US:GA:Loop"] = banneredShield(shields["US:GA"], ["LOOP"]); - shields["US:GA:Connector"] = banneredShield(shields["US:GA"], ["CONN"]); - shields["US:GA:Bypass"] = banneredShield(shields["US:GA"], ["BYP"]); - shields["US:GA:Business"] = banneredShield(shields["US:GA"], ["BUS"]); - shields["US:GA:Alternate"] = banneredShield(shields["US:GA"], ["ALT"]); // Guam shields["US:GU"] = { From 30d9bb399358edbcb06483a194f2416db22c244d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 31 May 2024 22:57:19 -0400 Subject: [PATCH 11/44] Revert accidental changes --- src/js/shield_defs.js | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 2d581ec0c..75df038f6 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -106,7 +106,11 @@ export function loadShields() { shields["GLCT"] = { notext: true, }; - shields["GLCT:Loop"] = (shields["GLCT"], ["LOOP"], Color.shields.brown); + shields["GLCT:Loop"] = banneredShield( + shields["GLCT"], + ["LOOP"], + Color.shields.brown + ); // Canada shields["CA:transcanada"] = { @@ -241,9 +245,10 @@ export function loadShields() { colorLighten: Color.shields.white, colorDarken: Color.shields.blue, }; - shields["CA:ON:private_toll"] = - (pillShield(Color.shields.white, Color.shields.blue, Color.shields.black), - ["ETR"]); + shields["CA:ON:private_toll"] = banneredShield( + pillShield(Color.shields.white, Color.shields.blue, Color.shields.black), + ["ETR"] + ); shields["CA:ON:secondary"] = trapezoidUpShield( 10, Color.shields.white, @@ -327,8 +332,10 @@ export function loadShields() { Color.shields.black )) ); - shields["CA:ON:Hastings:Wollaston"] = - (roundedRectShield(Color.shields.white, Color.shields.black), ["TWP"]); + shields["CA:ON:Hastings:Wollaston"] = banneredShield( + roundedRectShield(Color.shields.white, Color.shields.black), + ["TWP"] + ); shields["CA:ON:Waterloo:Wellesley"] = ovalShield( Color.shields.white, Color.shields.black @@ -339,15 +346,21 @@ export function loadShields() { ); ["North Dumfries", "Wilmot"].forEach( (township) => - (shields[`CA:ON:Waterloo:${township}`] = - (shields["CA:ON:Waterloo"], ["TWP"])) + (shields[`CA:ON:Waterloo:${township}`] = banneredShield( + shields["CA:ON:Waterloo"], + ["TWP"] + )) ); ["Brant", "Durham", "Haldimand", "Norfolk"].forEach( (county) => - (shields[`CA:ON:${county}:Highway`] = - (shields[`CA:ON:${county}`], ["HWY"])) + (shields[`CA:ON:${county}:Highway`] = banneredShield( + shields[`CA:ON:${county}`], + ["HWY"] + )) ); - shields["CA:ON:Muskoka:West"] = (shields["CA:ON:Muskoka"], ["WEST"]); + shields["CA:ON:Muskoka:West"] = banneredShield(shields["CA:ON:Muskoka"], [ + "WEST", + ]); shields["CA:ON:Hamilton:Expressway"] = { notext: true, overrideByName: { From 15c50557fd35aba609958d2539e8d1944fdce158 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 31 May 2024 22:59:00 -0400 Subject: [PATCH 12/44] Idaho business routes --- src/js/shield_defs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 75df038f6..d6f5a18ef 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1026,8 +1026,10 @@ export function loadShields() { top: 1.5, bottom: 9, }, + bannerMap: { + "US:ID:Business": ["BUS"], + }, }; - shields["US:ID:Business"] = banneredShield(shields["US:ID"], ["BUS"]); // Illinois shields["US:IL"] = roundedRectShield( From 7729bd2266b6b1f68f67f8a5b7797288b6ce4e74 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 15:16:01 -0400 Subject: [PATCH 13/44] Kentucky --- src/js/shield_defs.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 0637ef448..ae7d450f9 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1159,8 +1159,13 @@ export function loadShields() { ); // Kentucky - shields["US:KY"] = pillShield(Color.shields.white, Color.shields.black); - shields["US:KY:Business"] = banneredShield(shields["US:KY"], ["BUS"]); + shields["US:KY"] = { + ...pillShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:KY:Business": ["BUS"], + }, + }; + shields["US:KY:AA"] = shields["US:KY:Parkway"] = { spriteBlank: "shield_us_ky_parkway", textColor: Color.shields.blue, From a18a2d96d70fbc057c93a3beecd9ffe280218aeb Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 15:18:23 -0400 Subject: [PATCH 14/44] Louisiana --- src/js/shield_defs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index ae7d450f9..7983246ba 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1187,10 +1187,13 @@ export function loadShields() { top: 7, bottom: 3, }, + bannerMap: { + "US:LA:Business": ["BUS"], + "US:LA:Spur": ["SPUR"], + "US:LA:Truck": ["TRK"], + }, }; - shields["US:LA:Business"] = banneredShield(shields["US:LA"], ["BUS"]); - shields["US:LA:Spur"] = banneredShield(shields["US:LA"], ["SPUR"]); - shields["US:LA:Truck"] = banneredShield(shields["US:LA"], ["TRK"]); + [ "Bienville", "Caddo", From 0f1ea1d6c5bce2f8c8cc7579ed8aa57dc4813f8f Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 15:20:55 -0400 Subject: [PATCH 15/44] Maryland --- src/js/shield_defs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 7983246ba..af8c88b8e 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1248,9 +1248,11 @@ export function loadShields() { top: 6, bottom: 2, }, + bannerMap: { + "US:MD:Alternate": ["ALT"], + "US:MD:Bypass": ["BYP"], + }, }; - shields["US:MD:Alternate"] = banneredShield(shields["US:MD"], ["ALT"]); - shields["US:MD:Bypass"] = banneredShield(shields["US:MD"], ["BYP"]); shields["US:MD:Business"] = banneredShield( { ...shields["US:MD"], From 08f040bdf0424dfe39922a2c396887e6d0aaf3dc Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 16:59:54 -0400 Subject: [PATCH 16/44] Maine --- src/js/shield_defs.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index af8c88b8e..223dbe1de 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1264,11 +1264,12 @@ export function loadShields() { ); // Maine - shields["US:ME"] = roundedRectShield( - Color.shields.white, - Color.shields.black - ); - shields["US:ME:Business"] = banneredShield(shields["US:ME"], ["BUS"]); + shields["US:ME"] = { + ...roundedRectShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:ME:Business": ["BUS"], + }, + }; shields["US:ME:Turnpike"] = { spriteBlank: "shield_us_me_turnpike", notext: true, From bc0dff7dc1edd6009924ef2f05a2a707f24dc64d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:02:24 -0400 Subject: [PATCH 17/44] Michigan --- src/js/shield_defs.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 223dbe1de..b87e43e12 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1276,10 +1276,13 @@ export function loadShields() { }; // Michigan - shields["US:MI"] = diamondShield(Color.shields.white, Color.shields.black); - shields["US:MI:Business"] = banneredShield(shields["US:MI"], ["BUS"]); - shields["US:MI:Connector"] = banneredShield(shields["US:MI"], ["CONN"]); - ["CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon"].forEach( + shields["US:MI"] = { + ...diamondShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:MI:Business": ["BUS"], + "US:MI:Connector": ["CONN"], + }, + }[("CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon")].forEach( (county) => (shields[`US:MI:${county}`] = pentagonUpShield( 3, From 8d7bc4634df108d122bffef19532bc5ef8885753 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:07:09 -0400 Subject: [PATCH 18/44] Missouri --- src/js/shield_defs.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index b87e43e12..11a813f73 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1464,18 +1464,18 @@ export function loadShields() { top: 2, bottom: 5, }, + bannerMap: { + "US:MO:Alternate": ["ALT"], + "US:MO:Business": ["BUS"], + "US:MO:Spur": ["SPUR"], + }, + }; + shields["US:MO:Supplemental"] = { + ...roundedRectShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:MO:Supplemental:Spur": ["SPUR"], + }, }; - shields["US:MO:Alternate"] = banneredShield(shields["US:MO"], ["ALT"]); - shields["US:MO:Business"] = banneredShield(shields["US:MO"], ["BUS"]); - shields["US:MO:Spur"] = banneredShield(shields["US:MO"], ["SPUR"]); - shields["US:MO:Supplemental"] = roundedRectShield( - Color.shields.white, - Color.shields.black - ); - shields["US:MO:Supplemental:Spur"] = banneredShield( - shields["US:MO:Supplemental"], - ["SPUR"] - ); [ "Bollinger", "Butler", From 187276e51e924bbde75124b3fc6b071f9f293cc4 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:10:50 -0400 Subject: [PATCH 19/44] Fix formatting --- src/js/shield_defs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 11a813f73..efdb66824 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1282,7 +1282,8 @@ export function loadShields() { "US:MI:Business": ["BUS"], "US:MI:Connector": ["CONN"], }, - }[("CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon")].forEach( + }; + ["CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon"].forEach( (county) => (shields[`US:MI:${county}`] = pentagonUpShield( 3, From 0c53b5a1bf9eb207c3776c43b23cdcca2f518408 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:14:03 -0400 Subject: [PATCH 20/44] North Carolina --- src/js/shield_defs.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index efdb66824..e0dac9354 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1570,16 +1570,20 @@ export function loadShields() { ); // North Carolina - shields["US:NC"] = diamondShield( - Color.shields.white, - Color.shields.black, - Color.shields.black, - 2, - 24 - ); - shields["US:NC:Bypass"] = banneredShield(shields["US:NC"], ["BYP"]); - shields["US:NC:Business"] = banneredShield(shields["US:NC"], ["BUS"]); - shields["US:NC:Truck"] = banneredShield(shields["US:NC"], ["TRK"]); + shields["US:NC"] = { + ...diamondShield( + Color.shields.white, + Color.shields.black, + Color.shields.black, + 2, + 24 + ), + bannerMap: { + "US:NC:Bypass": ["BYP"], + "US:NC:Business": ["BUS"], + "US:NC:Truck": ["TRK"], + }, + }; shields["US:NC:Mecklenburg:Charlotte"] = pentagonUpShield( 3, 15, From 9ca4f13c4f0d2d64e4e10aed9696682b85b1be11 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:15:42 -0400 Subject: [PATCH 21/44] North Dakota --- src/js/shield_defs.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index e0dac9354..21eb214ef 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1601,11 +1601,13 @@ export function loadShields() { top: 4, bottom: 4, }, + bannerMap: { + "US:ND:Alternate": ["ALT"], + "US:ND:Business": ["BUS"], + "US:ND:Bypass": ["BYP"], + "US:ND:Truck": ["TRK"], + }, }; - shields["US:ND:Alternate"] = banneredShield(shields["US:ND"], ["ALT"]); - shields["US:ND:Business"] = banneredShield(shields["US:ND"], ["BUS"]); - shields["US:ND:Bypass"] = banneredShield(shields["US:ND"], ["BYP"]); - shields["US:ND:Truck"] = banneredShield(shields["US:ND"], ["TRK"]); [ "Barnes", "Benson", From 3848b8803e2a0bc5785cee89487073e1f6963c61 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:18:23 -0400 Subject: [PATCH 22/44] Nebraska --- src/js/shield_defs.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 21eb214ef..df1464b73 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1665,16 +1665,16 @@ export function loadShields() { ); // Nebraska - shields["US:NE"] = trapezoidDownShield( - 10, - Color.shields.white, - Color.shields.black - ); - shields["US:NE:Business"] = banneredShield(shields["US:NE"], ["BUS"]); - shields["US:NE:Link"] = banneredShield(shields["US:NE"], ["LINK"]); - shields["US:NE:Rec"] = banneredShield(shields["US:NE"], ["REC"]); - shields["US:NE:Spur"] = banneredShield(shields["US:NE"], ["SPUR"]); - shields["US:NE:Truck"] = banneredShield(shields["US:NE"], ["TRK"]); + shields["US:NE"] = { + ...trapezoidDownShield(10, Color.shields.white, Color.shields.black), + bannerMap: { + "US:NE:Business": ["BUS"], + "US:NE:Link": ["LINK"], + "US:NE:Rec": ["REC"], + "US:NE:Spur": ["SPUR"], + "US:NE:Truck": ["TRK"], + }, + }; shields["US:NE:Scenic"] = { spriteBlank: "shield_us_ne_byway_noref", notext: true, From 4abd9a21edb98af47cff27708e0d038794bc3d21 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:20:37 -0400 Subject: [PATCH 23/44] New Hampshire --- src/js/shield_defs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index df1464b73..9deca6839 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1690,8 +1690,10 @@ export function loadShields() { top: 4, bottom: 5, }, + bannerMap: { + "US:NH:Bypass": ["BYP"], + }, }; - shields["US:NH:Bypass"] = banneredShield(shields["US:NH"], ["BYP"]); shields["US:NH:Turnpike"] = { notext: true, }; From 963aa6d368750cccf41f0a819c09f2ae0b34db6f Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:25:14 -0400 Subject: [PATCH 24/44] New Jersey --- src/js/shield_defs.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 9deca6839..daddbacba 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1703,12 +1703,11 @@ export function loadShields() { shields["US:NJ:ACE"] = { spriteBlank: "shield_us_nj_ace_noref", notext: true, + bannerTextColor: Color.shields.blue, + bannerMap: { + "US:NJ:ACE:Connector": ["CONN"], + }, }; - shields["US:NJ:ACE:Connector"] = banneredShield( - shields["US:NJ:ACE"], - ["CONN"], - Color.shields.blue - ); shields["US:NJ:GSP"] = { spriteBlank: "shield_us_nj_gsp_noref", notext: true, From 8df339d12e373129592247fc3bedd5e1f03ba85e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:46:07 -0400 Subject: [PATCH 25/44] New York --- src/js/shield_defs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index daddbacba..e6e676249 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1859,8 +1859,10 @@ export function loadShields() { top: 5, bottom: 5, }, + bannerMap: { + "US:NY:Truck": ["TRK"], + }, }; - shields["US:NY:Truck"] = banneredShield(shields["US:NY"], ["TRK"]); shields["US:NY:Thruway"] = { noref: { spriteBlank: "shield_us_ny_thruway", From 7aa0d47d5c5e9474da1223eaa561118d93db2a80 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:47:53 -0400 Subject: [PATCH 26/44] Ohio --- src/js/shield_defs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index e6e676249..4f4999a15 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1969,9 +1969,11 @@ export function loadShields() { top: 4, bottom: 6, }, + bannerMap: { + "US:OH:Bypass": ["BYP"], + "US:OH:Business": ["BUS"], + }, }; - shields["US:OH:Bypass"] = banneredShield(shields["US:OH"], ["BYP"]); - shields["US:OH:Business"] = banneredShield(shields["US:OH"], ["BUS"]); shields["US:OH:Turnpike"] = { spriteBlank: "shield_us_oh_turnpike", notext: true, From 9ad1ad74c9886d59d01120bedc00600afe53979e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:50:42 -0400 Subject: [PATCH 27/44] Oklahoma --- src/js/shield_defs.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 4f4999a15..6cb43dde7 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2183,12 +2183,14 @@ export function loadShields() { top: 7, bottom: 3, }, + bannerMap: { + "US:OK:Toll": [], + "US:OK:Business": ["BUS"], + "US:OK:Loop": ["LOOP"], + "US:OK:Spur": ["SPUR"], + "US:OK:Truck": ["TRK"], + }, }; - shields["US:OK:Toll"] = shields["US:OK"]; - shields["US:OK:Business"] = banneredShield(shields["US:OK"], ["BUS"]); - shields["US:OK:Loop"] = banneredShield(shields["US:OK"], ["LOOP"]); - shields["US:OK:Spur"] = banneredShield(shields["US:OK"], ["SPUR"]); - shields["US:OK:Truck"] = banneredShield(shields["US:OK"], ["TRK"]); shields["US:OK:Turnpike"] = { spriteBlank: "shield_us_ok_turnpike", notext: true, From 65ab136dbe30773b948503a0c44404215585fc94 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:51:48 -0400 Subject: [PATCH 28/44] Oregon --- src/js/shield_defs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 6cb43dde7..a0d3cc796 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2207,8 +2207,10 @@ export function loadShields() { top: 1, bottom: 4, }, + bannerMap: { + "US:OR:Business": ["BUS"], + }, }; - shields["US:OR:Business"] = banneredShield(shields["US:OR"], ["BUS"]); ["Douglas", "Grant", "Lake", "Lane", "Morrow"].forEach( (county) => (shields[`US:OR:${county}`] = pentagonUpShield( From 9aa207741898cf209017939e7e3dd93313d587af Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:58:30 -0400 Subject: [PATCH 29/44] PA and SC --- src/js/shield_defs.js | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index a0d3cc796..7160bd2ae 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2231,10 +2231,12 @@ export function loadShields() { top: 5, bottom: 5, }, + bannerMap: { + "US:PA:Truck": ["TRK"], + "US:PA:Business": ["BUS"], + "US:PA:Alternate": ["ALT"], + }, }; - shields["US:PA:Truck"] = banneredShield(shields["US:PA"], ["TRK"]); - shields["US:PA:Business"] = banneredShield(shields["US:PA"], ["BUS"]); - shields["US:PA:Alternate"] = banneredShield(shields["US:PA"], ["ALT"]); shields["US:PA:Turnpike"] = { spriteBlank: ["shield_us_pa_2", "shield_us_pa_3"], textColor: Color.shields.white, @@ -2286,33 +2288,20 @@ export function loadShields() { shields["US:SC"] = { spriteBlank: "shield_us_sc", textColor: Color.shields.blue, + bannerTextColor: Color.shields.blue, padding: { left: 2, right: 2, top: 6, bottom: 3, }, + bannerMap: { + "US:SC:Truck": ["TRK"], + "US:SC:Business": ["BUS"], + "US:SC:Alternate": ["ALT"], + "US:SC:Connector": ["CONN"], + }, }; - shields["US:SC:Truck"] = banneredShield( - shields["US:SC"], - ["TRK"], - Color.shields.blue - ); - shields["US:SC:Business"] = banneredShield( - shields["US:SC"], - ["BUS"], - Color.shields.blue - ); - shields["US:SC:Alternate"] = banneredShield( - shields["US:SC"], - ["ALT"], - Color.shields.blue - ); - shields["US:SC:Connector"] = banneredShield( - shields["US:SC"], - ["CONN"], - Color.shields.blue - ); // South Dakota shields["US:SD"] = { From c5ce6a2a986f77c85d95a65c55b377d85834c0c3 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 17:59:58 -0400 Subject: [PATCH 30/44] South Dakota --- src/js/shield_defs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 7160bd2ae..19a180543 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2313,9 +2313,11 @@ export function loadShields() { top: 3, bottom: 5, }, + bannerMap: { + "US:SD:Business": ["BUS"], + "US:SD:Truck": ["US:SD"], + }, }; - shields["US:SD:Business"] = banneredShield(shields["US:SD"], ["BUS"]); - shields["US:SD:Truck"] = banneredShield(shields["US:SD"], ["TRK"]); shields["US:SD:Secondary"] = roundedRectShield( Color.shields.white, Color.shields.black From 5759d1912f2b36c970323c6135fef054ba15b6c6 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:03:35 -0400 Subject: [PATCH 31/44] Tennessee --- src/js/shield_defs.js | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 19a180543..566ded21a 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2398,32 +2398,20 @@ export function loadShields() { top: 2, bottom: 7, }, + bannerMap: { + "US:TN:primary:Business": ["BUS"], + "US:TN:primary:Bypass": ["BYP"], + "US:TN:primary:Truck": ["TRK"], + }, + }; + shields["US:TN:secondary"] = { + ...triangleDownShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:TN:secondary:Alternate": ["ALT"], + "US:TN:secondary:Scenic": ["SCEN"], + "US:TN:secondary:Truck": ["TRK"], + }, }; - shields["US:TN:primary:Business"] = banneredShield(shields["US:TN:primary"], [ - "BUS", - ]); - shields["US:TN:primary:Bypass"] = banneredShield(shields["US:TN:primary"], [ - "BYP", - ]); - shields["US:TN:primary:Truck"] = banneredShield(shields["US:TN:primary"], [ - "TRK", - ]); - shields["US:TN:secondary"] = triangleDownShield( - Color.shields.white, - Color.shields.black - ); - shields["US:TN:secondary:Alternate"] = banneredShield( - shields["US:TN:secondary"], - ["ALT"] - ); - shields["US:TN:secondary:Scenic"] = banneredShield( - shields["US:TN:secondary"], - ["SCEN"] - ); - shields["US:TN:secondary:Truck"] = banneredShield( - shields["US:TN:secondary"], - ["TRK"] - ); shields["US:TN:McMinn"] = pentagonUpShield( 3, 15, From 3ec820376f8ab3383173e51b2b6c44c21b01d59d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:23:58 -0400 Subject: [PATCH 32/44] Texas --- src/js/shield_defs.js | 73 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 566ded21a..63c53a012 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2420,17 +2420,18 @@ export function loadShields() { ); // Texas - shields["US:TX"] = roundedRectShield( - Color.shields.white, - Color.shields.black - ); - shields["US:TX:Beltway"] = banneredShield(shields["US:TX"], ["BELT"]); - shields["US:TX:Business"] = banneredShield(shields["US:TX"], ["BUS"]); - shields["US:TX:Loop"] = banneredShield(shields["US:TX"], ["LOOP"]); - shields["US:TX:NASA"] = banneredShield(shields["US:TX"], ["NASA"]); - shields["US:TX:Park"] = banneredShield(shields["US:TX"], ["PARK"]); - shields["US:TX:PA"] = banneredShield(shields["US:TX"], ["P.A."]); - shields["US:TX:Spur"] = banneredShield(shields["US:TX"], ["SPUR"]); + shields["US:TX"] = { + ...roundedRectShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:TX:Beltway": ["BELT"], + "US:TX:Business": ["BUS"], + "US:TX:Loop": ["LOOP"], + "US:TX:NASA": ["NASA"], + "US:TX:Park": ["PARK"], + "US:TX:PA": ["P.A."], + "US:TX:Spur": ["SPUR"], + }, + }; shields["US:TX:FM"] = shields["US:TX:RM"] = { spriteBlank: "shield_us_tx_outline", textColor: Color.shields.black, @@ -2441,8 +2442,10 @@ export function loadShields() { top: 7, bottom: 10, }, + bannerMap: { + "US:TX:FM:Business": ["BUS"], + }, }; - shields["US:TX:FM:Business"] = banneredShield(shields["US:TX:FM"], ["BUS"]); shields["US:TX:Recreational"] = banneredShield( { ...shields["US:TX:FM"], @@ -2452,38 +2455,32 @@ export function loadShields() { ["R"], Color.shields.brown ); - shields["US:TX:NASA"] = banneredShield(shields["US:TX"], ["NASA"]); // Texas toll roads + shields["US:TX:Toll"] = { + ...roundedRectShield(Color.shields.blue, Color.shields.white), + bannerTextColor: Color.shields.blue, + bannerMap: { + "US:TX:NTTA": [], + "US:TX:Express:Toll": ["EXPR"], + "US:TX:Loop:Toll": ["LOOP"], + "US:TX:Loop:Express:Toll": ["EXPR", "LOOP"], + }, + }; shields["US:TX:Toll"] = shields["US:TX:NTTA"] = roundedRectShield( Color.shields.blue, Color.shields.white ); - shields["US:TX:Express:Toll"] = banneredShield( - shields["US:TX:Toll"], - ["EXPR"], - Color.shields.blue - ); - shields["US:TX:Loop:Toll"] = banneredShield( - shields["US:TX:Toll"], - ["LOOP"], - Color.shields.blue - ); - shields["US:TX:Loop:Express:Toll"] = banneredShield( - shields["US:TX:Toll"], - ["EXPR", "LOOP"], - Color.shields.blue - ); - shields["US:TX:CTRMA"] = roundedRectShield( - Color.shields.blue, - Color.shields.yellow, - Color.shields.white - ); - shields["US:TX:CTRMA:Express"] = banneredShield( - shields["US:TX:CTRMA"], - ["EXPR"], - Color.shields.blue - ); + shields["US:TX:CTRMA"] = { + ...roundedRectShield( + Color.shields.blue, + Color.shields.yellow, + Color.shields.white + ), + bannerMap: { + "US:TX:CTRMA:Express": ["EXPR"], + }, + }; shields["US:TX:Montgomery:MCTRA"] = homePlateDownShield( 5, Color.shields.blue, From f1afce521cc697b85e03f88b810e186bde17e944 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:26:16 -0400 Subject: [PATCH 33/44] Virgina --- src/js/shield_defs.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 63c53a012..5f3ed6341 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2596,15 +2596,19 @@ export function loadShields() { ); // Virginia - shields["US:VA"] = escutcheonDownShield( - 12, - Color.shields.white, - Color.shields.black, - Color.shields.black, - 2 - ); - shields["US:VA:Business"] = banneredShield(shields["US:VA"], ["BUS"]); - shields["US:VA:Alternate"] = banneredShield(shields["US:VA"], ["ALT"]); + shields["US:VA"] = { + ...escutcheonDownShield( + 12, + Color.shields.white, + Color.shields.black, + Color.shields.black, + 2 + ), + bannerMap: { + "US:VA:Business": ["BUS"], + "US:VA:Alternate": ["ALT"], + }, + }; shields["US:VA:Secondary"] = pillShield( Color.shields.white, Color.shields.black From 4cd493d11719318bda9f54f3bd171370cc3c73a7 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:28:03 -0400 Subject: [PATCH 34/44] Vermont --- src/js/shield_defs.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 5f3ed6341..2f5a149fb 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2627,17 +2627,12 @@ export function loadShields() { top: 5, bottom: 2, }, + bannerTextColor: Color.shields.green, + bannerMap: { + "US:VT:Alternate": ["ALT"], + "US:VT:Truck": ["TRK"], + }, }; - shields["US:VT:Alternate"] = banneredShield( - shields["US:VT"], - ["ALT"], - Color.shields.green - ); - shields["US:VT:Truck"] = banneredShield( - shields["US:VT"], - ["TRK"], - Color.shields.green - ); // Vermont routes town maintained sections - black and white ovals shields["US:VT:Town"] = ovalShield(Color.shields.white, Color.shields.black); From 042f0d9eab970a7b903515e33fb55bb60363b751 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:29:28 -0400 Subject: [PATCH 35/44] Washington state --- src/js/shield_defs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 2f5a149fb..9216ed7f6 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2648,10 +2648,12 @@ export function loadShields() { top: 2, bottom: 6, }, + bannerMap: { + "US:WA:Spur": ["SPUR"], + "US:WA:Business": ["BUS"], + "US:WA:Alternate": ["ALT"], + }, }; - shields["US:WA:Spur"] = banneredShield(shields["US:WA"], ["SPUR"]); - shields["US:WA:Business"] = banneredShield(shields["US:WA"], ["BUS"]); - shields["US:WA:Alternate"] = banneredShield(shields["US:WA"], ["ALT"]); shields["US:WA:Asotin"] = roundedRectShield( Color.shields.green, From 202a2368ab2051dccdf9cb16afd5e6cc765442ed Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:40:06 -0400 Subject: [PATCH 36/44] Indonesia --- src/js/shield_defs.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 9216ed7f6..d90ee113a 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2670,9 +2670,11 @@ export function loadShields() { top: 3, bottom: 6, }, + bannerMap: { + "US:WI:Business": ["BUS"], + "US:WI:Spur": ["SPUR"], + }, }; - shields["US:WI:Business"] = banneredShield(shields["US:WI"], ["BUS"]); - shields["US:WI:Spur"] = banneredShield(shields["US:WI"], ["SPUR"]); [ "Adams", "Ashland", @@ -2753,10 +2755,9 @@ export function loadShields() { Color.shields.black )) ); - shields["US:WI:Marquette:Truck"] = banneredShield( - shields["US:WI:Marquette"], - ["TRK"] - ); + shields["US:WI:Marquette"].bannerMap = { + "US:WI:Marquette:Truck": ["TRK"], + }; shields["US:WI:Rustic"] = { spriteBlank: "shield_us_wi_rustic", textColor: Color.shields.yellow, @@ -3077,8 +3078,10 @@ export function loadShields() { top: 4, bottom: 2, }, + bannerMap: { + "ID:toll": ["TOL"], + }, }; - shields["ID:toll"] = banneredShield(shields["ID:national"], ["TOL"]); // Iran shields["ir:freeways"] = roundedRectShield( From 97151150cbd19494b7e2de43e1a86cbc7876be1e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:41:56 -0400 Subject: [PATCH 37/44] Bump shieldlib version --- shieldlib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shieldlib/package.json b/shieldlib/package.json index 552bc910a..f92282f28 100644 --- a/shieldlib/package.json +++ b/shieldlib/package.json @@ -1,7 +1,7 @@ { "name": "@americana/maplibre-shield-generator", "description": "Generate highway shields for maplibre-gl-js maps", - "version": "0.0.5", + "version": "0.0.6", "author": "OpenStreetMap Americana Contributors", "type": "module", "keywords": [ From e9bbe8335e5c6c7ddfa79d2aa80a1991c0e9f80e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 1 Jun 2024 18:50:54 -0400 Subject: [PATCH 38/44] Add bannerMap to docs --- shieldlib/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shieldlib/README.md b/shieldlib/README.md index fcadf3237..0d98699f5 100644 --- a/shieldlib/README.md +++ b/shieldlib/README.md @@ -136,6 +136,10 @@ You should create one definition entry for each network. The entry key must matc } }, "banners": ["ALT"], + "bannerMap": { + "ThisNetwork:Truck": ["TRK"], + "ThisNetwork:Truck:Bypass": ["TRK", "BYP"] + }, "bannerTextColor": "#000", "bannerTextHaloColor": "#FFF", "textLayout": { @@ -176,6 +180,7 @@ You should create one definition entry for each network. The entry key must matc ![Bannered routes near Downington, PA](https://wiki.openstreetmap.org/w/images/f/f8/Downington_bannered_routes_Americana.png) +- **`bannerMap`**: a map of network-to-banner arrays listing networks that should have the same style but with specified banners. - **`bannerTextColor`**: specify the color of the banner text. - **`bannerTextHaloColor`**: specify the color of the banner knockout halo. - **`textLayout`**: specify how text should be inscribed within the padded bounds of the shield. The text will be drawn at the maximum size allowed by this constraint. See the [text layout functions](#text-layout-functions) section for text layout options. From 2c595cc994f537675ce28920660d7177502ddfbb Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Tue, 4 Jun 2024 15:09:13 -0400 Subject: [PATCH 39/44] Update src/js/shield_defs.js Co-authored-by: Clay Smalley --- src/js/shield_defs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 9d993651e..c69a12e42 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2331,7 +2331,7 @@ export function loadShields() { }, bannerMap: { "US:SD:Business": ["BUS"], - "US:SD:Truck": ["US:SD"], + "US:SD:Truck": ["TRK"], }, }; shields["US:SD:Secondary"] = roundedRectShield( From 3ce0ab7608a96f2d1dbb4b2a15bd65158c1eca02 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 5 Jun 2024 13:14:26 -0400 Subject: [PATCH 40/44] Update shield_defs.js California business routes --- src/js/shield_defs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index c69a12e42..c57e86cb3 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -815,8 +815,10 @@ export function loadShields() { top: 6, bottom: 4, }, + bannerMap: { + "US:CA:Business": ["BUS"] + } }; - shields["US:CA:Business"] = (shields["US:CA"], ["BUS"], Color.shields.green); ["CR", "Sierra"].forEach( (county) => (shields[`US:CA:${county}`] = pentagonUpShield( From d2e8826d80b8238f2cf8b31dade602117165f86e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 5 Jun 2024 15:48:32 -0400 Subject: [PATCH 41/44] Update shield_defs.js --- src/js/shield_defs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 42fb66dff..26be26f7f 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1395,7 +1395,7 @@ export function loadShields() { "US:MI:Business": ["BUS"], "US:MI:Connector": ["CONN"], }, - overrideByRef = { + overrideByRef: { 185: diamondShield( Color.shields.brown, Color.shields.white, From 97fb4a41d0c3407a7fe36ebc1149f86ce586a62c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 5 Jun 2024 16:17:26 -0400 Subject: [PATCH 42/44] Update shield_defs.js Formatting --- src/js/shield_defs.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 26be26f7f..802d5eef6 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1396,13 +1396,7 @@ export function loadShields() { "US:MI:Connector": ["CONN"], }, overrideByRef: { - 185: diamondShield( - Color.shields.brown, - Color.shields.white, - Color.shields.white, - 0, - 24 - ), + 185: diamondShield(Color.shields.brown, Color.shields.white, Color.shields.white, 0, 24), }, }; ["CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon"].forEach( From a04de92eb1d6440441b55e2fd0712ff619412a88 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 5 Jun 2024 16:22:20 -0400 Subject: [PATCH 43/44] Update shield_defs.js Prettier --- src/js/shield_defs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 802d5eef6..f75807f0d 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1396,9 +1396,16 @@ export function loadShields() { "US:MI:Connector": ["CONN"], }, overrideByRef: { - 185: diamondShield(Color.shields.brown, Color.shields.white, Color.shields.white, 0, 24), + 185: diamondShield( + Color.shields.brown, + Color.shields.white, + Color.shields.white, + 0, + 24, + ), }, }; + ["CR", "Benzie", "Gogebic", "Kalkaska", "Montcalm", "Roscommon"].forEach( (county) => (shields[`US:MI:${county}`] = pentagonUpShield( From 38aeaf84b05017cde8899f15d3e09f239c61eb81 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 5 Jun 2024 17:47:31 -0400 Subject: [PATCH 44/44] prettier --- src/js/shield_defs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index f75807f0d..00c9c5cc5 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -904,8 +904,8 @@ export function loadShields() { bottom: 4, }, bannerMap: { - "US:CA:Business": ["BUS"] - } + "US:CA:Business": ["BUS"], + }, }; ["CR", "Sierra"].forEach( (county) => @@ -1396,12 +1396,12 @@ export function loadShields() { "US:MI:Connector": ["CONN"], }, overrideByRef: { - 185: diamondShield( + 185: diamondShield( Color.shields.brown, Color.shields.white, Color.shields.white, 0, - 24, + 24 ), }, };