From 73598d19e61009ffa99c94dc9657334a2e0ae51c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 18 May 2024 20:24:22 -0400 Subject: [PATCH 01/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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/61] 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 ), }, }; From cde59f84a79cae00f1654c54cc77aec389ba8530 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:07:41 -0700 Subject: [PATCH 45/61] Add suburb, quarter, neighborhood rendering --- src/layer/index.js | 3 + src/layer/place.js | 149 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) diff --git a/src/layer/index.js b/src/layer/index.js index 740eb6061..e23a4c422 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -232,6 +232,9 @@ export function build(locales) { lyrPoi.poi, lyrPlace.state, + lyrPlace.neighborhood, + lyrPlace.quarter, + lyrPlace.suburb, lyrPlace.village, lyrPlace.town, lyrPlace.city, diff --git a/src/layer/place.js b/src/layer/place.js index 611199a7d..d5556d131 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -208,6 +208,155 @@ export const city = { metadata: {}, }; +export const suburb = { + id: "place_suburb", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "suburb"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [10, 10], + [12, 14], + [14, 18], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 15, + minzoom: 11, + "source-layer": "place", +}; + +export const quarter = { + id: "place_quarter", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "quarter"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [13, 12], + [14, 14], + [16, 18], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 16, + minzoom: 13, + "source-layer": "place", +}; + +export const neighborhood = { + id: "place_neighborhood", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "neighbourhood"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [14, 12], + [16, 14], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 17, + minzoom: 14, + "source-layer": "place", +}; + export const state = { id: "place_state", type: "symbol", From 38501caf48a80f127c93e4e9ddc4f3a7ca3e2a5e Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:10:43 -0700 Subject: [PATCH 46/61] Add legend entries As described in original PR, but neglected to actually merge. --- src/layer/place.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/layer/place.js b/src/layer/place.js index d5556d131..4d9639d9a 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -590,6 +590,18 @@ export const legendEntries = [ description: "Small village", layers: [village.id], filter: nonCapitalFilter, + }, + { + description: "Major district", + layers: [suburb.id], + }, + { + description: "Large neighborhood", + layers: [quarter.id], + }, + { + description: "Neighborhood", + layers: [neighborhood.id], }, { description: "National capital", From c188be073f94507d56dd0866bc1d580054ce0da8 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:14:22 -0700 Subject: [PATCH 47/61] Whitespace error --- src/layer/place.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/place.js b/src/layer/place.js index 4d9639d9a..f4d10f865 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -591,7 +591,7 @@ export const legendEntries = [ layers: [village.id], filter: nonCapitalFilter, }, - { + { description: "Major district", layers: [suburb.id], }, From 3a73a98f8b51c72632c38c1c08600ceaef6e99f1 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:32:39 -0700 Subject: [PATCH 48/61] Font size and spacing upgrades Make suburb labels bigger at z11 and 12, and make letter spacing increase with zoom level for all three place values --- src/layer/place.js | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/layer/place.js b/src/layer/place.js index f4d10f865..fdb6e1b2c 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -231,15 +231,23 @@ export const suburb = { "text-size": { base: 1.2, stops: [ - [10, 10], - [12, 14], + [10, 12], + [12, 15], [14, 18], ], }, "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [11, 0.04], + [12, 0.08], + [13, 0.2], + [14, 0.4], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -289,7 +297,13 @@ export const quarter = { "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [14, 0.08], + [15, 0.2], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -338,7 +352,13 @@ export const neighborhood = { "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [15, 0.08], + [16, 0.2], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", From f679a6303ec7e065a0d59d97f7a287a8385e2ef3 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:44:05 -0700 Subject: [PATCH 49/61] Taginfo for places --- scripts/taginfo_template.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 672adcccb..f2e38c92d 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -47,6 +47,27 @@ "doc_url": "https://openmaptiles.org/schema/#capital", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" }, + { + "key": "place", + "value": "suburb", + "object_types": ["node"], + "description": "Suburbs are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, + { + "key": "place", + "value": "quarter", + "object_types": ["node"], + "description": "Quarters are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, + { + "key": "place", + "value": "neighbourhood", + "object_types": ["node"], + "description": "Neighborhoods are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, { "key": "disputed", "value": "yes", From d2f392e0627b4b187545a6d98235d8fe880a298f Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:45:37 -0700 Subject: [PATCH 50/61] Prettify --- scripts/taginfo_template.json | 6 +++--- src/layer/place.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index f2e38c92d..fdac3eed5 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -52,21 +52,21 @@ "value": "suburb", "object_types": ["node"], "description": "Suburbs are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "place", "value": "quarter", "object_types": ["node"], "description": "Quarters are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "place", "value": "neighbourhood", "object_types": ["node"], "description": "Neighborhoods are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "disputed", diff --git a/src/layer/place.js b/src/layer/place.js index fdb6e1b2c..192c3a086 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -240,14 +240,14 @@ export const suburb = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [11, 0.04], [12, 0.08], [13, 0.2], [14, 0.4], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -298,12 +298,12 @@ export const quarter = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [14, 0.08], [15, 0.2], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -353,12 +353,12 @@ export const neighborhood = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [15, 0.08], [16, 0.2], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", From 67140b536112d6f89ae662fdd3199be780051831 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:35:31 -0700 Subject: [PATCH 51/61] Rearrange taginfo more logically --- scripts/taginfo_template.json | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 6ff25da08..2266cf159 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -47,13 +47,6 @@ "doc_url": "https://openmaptiles.org/schema/#capital", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" }, - { - "key": "place", - "value": "suburb", - "object_types": ["node"], - "description": "Suburbs are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "capital", "value": "5", @@ -126,13 +119,6 @@ "description": "Continents are labeled in capital letters.", "doc_url": "https://openmaptiles.org/schema/#place" }, - { - "key": "place", - "value": "quarter", - "object_types": ["node"], - "description": "Quarters are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "place", "value": "country", @@ -140,13 +126,6 @@ "description": "Countries are labeled in mixed case.", "doc_url": "https://openmaptiles.org/schema/#place" }, - { - "key": "place", - "value": "neighbourhood", - "object_types": ["node"], - "description": "Neighborhoods are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "place", "value": "state", @@ -178,6 +157,27 @@ "doc_url": "https://openmaptiles.org/schema/#place", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/place_dot.svg" }, + { + "key": "place", + "value": "suburb", + "object_types": ["node"], + "description": "Suburbs are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "quarter", + "object_types": ["node"], + "description": "Quarters are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "neighbourhood", + "object_types": ["node"], + "description": "Neighborhoods are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, { "key": "disputed", "value": "yes", From 0d9879e5ec38c0ac134bdb24dc6efe2b38b8262e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 4 Aug 2024 20:32:58 -0400 Subject: [PATCH 52/61] Bump version --- shieldlib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shieldlib/package.json b/shieldlib/package.json index d6428db48..930987921 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.6", + "version": "0.0.7", "author": "OpenStreetMap Americana Contributors", "type": "module", "keywords": [ From cb9949b50594ba20512923bafe243c149cd26047 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 10 Sep 2024 20:58:52 -0400 Subject: [PATCH 53/61] Adding restaurant and fast food POI --- icons/poi_restaurant.svg | 4 ++++ src/layer/poi.js | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 icons/poi_restaurant.svg diff --git a/icons/poi_restaurant.svg b/icons/poi_restaurant.svg new file mode 100644 index 000000000..77e1fd2e3 --- /dev/null +++ b/icons/poi_restaurant.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/layer/poi.js b/src/layer/poi.js index 8fc48fc6b..b3c61b632 100644 --- a/src/layer/poi.js +++ b/src/layer/poi.js @@ -244,6 +244,15 @@ var iconDefs = { color: Color.poi.transport, description: "Tram stop", }, + restaurant: { + classes: { + restaurant: ["restaurant"], + fast_food: ["fast_food", "food_court"], + }, + sprite: "poi_restaurant", + color: Color.poi.consumer, + description: "Restaurant or fast food", + }, school: { classes: { school: ["kindergarten", "school"], @@ -336,6 +345,7 @@ export const poi = { ...getSubclasses(iconDefs.car_repair), ...getSubclasses(iconDefs.hotel), ...getSubclasses(iconDefs.hostel), + ...getSubclasses(iconDefs.restaurant), ], Color.poi.consumer, [ @@ -415,6 +425,7 @@ export const poi = { ...getSubclasses(iconDefs.taxi), ...getSubclasses(iconDefs.hotel), ...getSubclasses(iconDefs.hostel), + ...getSubclasses(iconDefs.restaurant), ], 16, ["clinic", "doctors", "parking"], From d2bbbd3d69dace37133f314a6f8bbc4e505e49ef Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Wed, 11 Sep 2024 19:41:12 -0400 Subject: [PATCH 54/61] add shields for Nevada County, California --- 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 1f810c38e..0bb1a83af 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -1023,7 +1023,7 @@ export function loadShields() { ["BUS"], Color.shields.green ); - ["CR", "Sierra"].forEach( + ["CR", "Nevada", "Sierra"].forEach( (county) => (shields[`US:CA:${county}`] = pentagonUpShield( 3, From 24204851150e10ba7f00bda59ab5702cfe96e77f Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 12 Sep 2024 18:40:50 -0400 Subject: [PATCH 55/61] Tweaking restaurant icon --- icons/poi_restaurant.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icons/poi_restaurant.svg b/icons/poi_restaurant.svg index 77e1fd2e3..87fb83907 100644 --- a/icons/poi_restaurant.svg +++ b/icons/poi_restaurant.svg @@ -1,4 +1,4 @@ - - - + + + From 77d416533da6e3acc6f8e52f85faeb5d36534925 Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Tue, 17 Sep 2024 21:41:38 -0500 Subject: [PATCH 56/61] Restore Historic US Route shield --- src/js/shield_defs.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index b634539b8..ebe732a8e 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -689,14 +689,15 @@ export function loadShields() { }, }; - shields["US:US:Historic"] = - ({ + shields["US:US:Historic"] = banneredShield( + { ...badgeShieldCrossbar, textColor: Color.shields.brown, colorLighten: Color.shields.brown, }, ["HIST"], - Color.shields.brown); + Color.shields.brown + ); // US Federal Agencies From bfafc9def2243b1adaef62bccb922a45359c11d3 Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Tue, 17 Sep 2024 22:41:51 -0500 Subject: [PATCH 57/61] Update retagged shield definitions --- src/js/shield_defs.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index b634539b8..5ae58e59b 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -3199,7 +3199,7 @@ export function loadShields() { // AFRICA // Algeria - shields["DZ:highway"] = shields["DZ:national"] = roundedRectShield( + shields["DZ:motorway"] = shields["DZ:national"] = roundedRectShield( Color.shields.red, Color.shields.white ); @@ -3383,7 +3383,7 @@ export function loadShields() { }; // Iran - shields["ir:freeways"] = roundedRectShield( + shields["ir:freeway"] = roundedRectShield( Color.shields.blue, Color.shields.white ); @@ -3569,11 +3569,11 @@ export function loadShields() { ); // Vietnam - shields["vn:expressway"] = roundedRectShield( + shields["VN:expressway"] = roundedRectShield( Color.shields.yellow, Color.shields.black ); - shields["vn:national"] = roundedRectShield( + shields["VN:national"] = roundedRectShield( Color.shields.white, Color.shields.black ); @@ -3947,13 +3947,12 @@ export function loadShields() { ); // Poland - shields["pl:motorways"] = roundedRectShield( + shields["pl:expressway"] = shields["pl:motorway"] = roundedRectShield( Color.shields.red, Color.shields.white, Color.shields.white, 34 ); - shields["pl:expressways"] = shields["pl:motorways"]; shields["pl:national"] = roundedRectShield( Color.shields.red, Color.shields.white From e82ff7f80a8a4ec1c09dc328572385cc327f97fb Mon Sep 17 00:00:00 2001 From: Clay Smalley Date: Tue, 24 Sep 2024 22:06:26 -0400 Subject: [PATCH 58/61] Add shield for Utah Federal Aid routes Federal Aid routes of Utah do not have guide signage, but are sometimes signed with mileposts that include the route number in a pentagonal "county" shield. The definition for `network=US:UT:Wayne` is removed here because it was a mistagging by yours truly, corrected [here.](https://www.openstreetmap.org/changeset/156846582) --- 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 0ed278a92..06df44179 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -2873,7 +2873,7 @@ export function loadShields() { bottom: 5, }, }; - ["Wayne", "Washington"].forEach( + ["FA", "Washington"].forEach( (county) => (shields[`US:UT:${county}`] = pentagonUpShield( 3, From 442676ee3a3b213d3f26def03714cb56709f7262 Mon Sep 17 00:00:00 2001 From: William Misener <58491489+wmisener@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:15:19 -0500 Subject: [PATCH 59/61] Rename color variable Same color as waterLabel, but now named urbanSubAreaLabel --- src/constants/color.js | 2 ++ src/layer/place.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/constants/color.js b/src/constants/color.js index e2bf7bdc7..cf6851c19 100644 --- a/src/constants/color.js +++ b/src/constants/color.js @@ -28,6 +28,8 @@ export const airportOutline = "hsl(250, 41%, 79%)"; export const airportRunway = "hsl(250, 41%, 79%)"; export const airportLabel = "hsl(250, 71%, 29%)"; +export const urbanSubAreaLabel = "hsl(211, 43%, 28%)"; + //TODO - rename this variable to "palette" export const palette = { black: "black", diff --git a/src/layer/place.js b/src/layer/place.js index 192c3a086..0abda0ef0 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -212,7 +212,7 @@ export const suburb = { id: "place_suburb", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", @@ -270,7 +270,7 @@ export const quarter = { id: "place_quarter", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", @@ -326,7 +326,7 @@ export const neighborhood = { id: "place_neighborhood", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", From 4197f75768c2b8f2a78b8b740f455898ffb38a8f Mon Sep 17 00:00:00 2001 From: William Misener <58491489+wmisener@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:47:18 -0500 Subject: [PATCH 60/61] Add restaurants to taginfo --- scripts/taginfo_template.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 9f332a06e..b667f6123 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -565,6 +565,30 @@ "doc_url": "https://openmaptiles.org/schema/#poi", "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_martini_glass.svg" }, + { + "key": "amenity", + "value": "restaurant", + "object_types": ["node", "area"], + "description": "Restaurants are marked by an icon representing a knife and fork.", + "doc_url": "https://openmaptiles.org/schema/#poi", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_restaurant.svg" + }, + { + "key": "amenity", + "value": "fast_food", + "object_types": ["node", "area"], + "description": "Restaurants are marked by an icon representing a knife and fork.", + "doc_url": "https://openmaptiles.org/schema/#poi", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_restaurant.svg" + }, + { + "key": "amenity", + "value": "food_court", + "object_types": ["node", "area"], + "description": "Restaurants are marked by an icon representing a knife and fork.", + "doc_url": "https://openmaptiles.org/schema/#poi", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_restaurant.svg" + }, { "key": "amenity", "value": "hospital", From ec2d603c454be2d55c960bd8bf668160400394eb Mon Sep 17 00:00:00 2001 From: William Misener <58491489+wmisener@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:23:58 -0500 Subject: [PATCH 61/61] Fixes icon links for capital icons in taginfo --- scripts/taginfo_template.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 9f332a06e..d6fe04842 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -21,7 +21,7 @@ "object_types": ["node"], "description": "Marks the city with a national capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star_in_circle.svg" }, { "key": "capital", @@ -29,7 +29,7 @@ "object_types": ["node"], "description": "Marks the city with a national capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star_in_circle.svg" }, { "key": "capital", @@ -37,7 +37,7 @@ "object_types": ["node"], "description": "Marks the city with a state capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star.svg" }, { "key": "capital", @@ -45,7 +45,7 @@ "object_types": ["node"], "description": "Marks the city with a state capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star.svg" }, { "key": "capital",