diff --git a/.github/workflows/deploy-pr-checks.yml b/.github/workflows/deploy-pr-checks.yml index 447659185..ccd25262a 100644 --- a/.github/workflows/deploy-pr-checks.yml +++ b/.github/workflows/deploy-pr-checks.yml @@ -13,7 +13,7 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: - name: "Download PR Number" - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ @@ -33,7 +33,7 @@ jobs: let fs = require('fs'); fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_ci_artifacts.zip`, Buffer.from(download.data)); - name: "Download Build" - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ @@ -119,7 +119,7 @@ jobs: app_id: 396440 #osm-americana checks app private_key: ${{ secrets.CHECKS_WRITER_SECRET }} - name: Print Preview Links to GitHub Checks - uses: LouisBrunner/checks-action@v1.6.1 + uses: LouisBrunner/checks-action@v2.0.0 if: always() with: sha: ${{ env.PR_SHA }} @@ -131,7 +131,7 @@ jobs: {"summary":"Preview map changes introduced by this PR", "title":"View live map and artifacts"} output_text_description_file: pr_preview.md - name: Print Stats to GitHub Checks - uses: LouisBrunner/checks-action@v1.6.1 + uses: LouisBrunner/checks-action@v2.0.0 if: always() with: sha: ${{ env.PR_SHA }} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 528a944bf..ee98eecfc 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,3 @@ # Code of Conduct -The OpenStreetMap Americana project has [opted in](https://github.com/ZeLonewolf/openstreetmap-americana/pull/489) to the [OpenStreetMap US Code of Conduct](https://wiki.openstreetmap.org/wiki/Foundation/Local_Chapters/United_States/Code_of_Conduct_Committee/OSM_US_Code_of_Conduct) (CoC) and [Process for Moderation](https://wiki.openstreetmap.org/wiki/Foundation/Local_Chapters/United_States/Code_of_Conduct_Committee/ModerationProcess). +The OpenStreetMap Americana project has [opted in](https://github.com/osm-americana/openstreetmap-americana/pull/489) to the [OpenStreetMap US Code of Conduct](https://wiki.openstreetmap.org/wiki/Foundation/Local_Chapters/United_States/Code_of_Conduct_Committee/OSM_US_Code_of_Conduct) (CoC) and [Process for Moderation](https://wiki.openstreetmap.org/wiki/Foundation/Local_Chapters/United_States/Code_of_Conduct_Committee/ModerationProcess). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c4e9a7e9..9bc473aa4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,8 +79,8 @@ sudo apt install nodejs [51]: https://www.macports.org/ [52]: https://nodejs.org [60]: https://docs.microsoft.com/en-us/windows/wsl/install-win10 -[62]: https://github.com/ZeLonewolf/openstreetmap-americana/issues/132 -[63]: https://github.com/ZeLonewolf/openstreetmap-americana/issues/132#issuecomment-1027274543 +[62]: https://github.com/osm-americana/openstreetmap-americana/issues/132 +[63]: https://github.com/osm-americana/openstreetmap-americana/issues/132#issuecomment-1027274543 ## Install Project Level NPM Dependencies @@ -353,7 +353,7 @@ This style strives to draw representative highway shields wherever they are tagg - Shields for route networks where each individual route is identified by a color, rather than a number or letter. Such cases include: - **Allegheny County, PA Belt Routes**. Shields for this system use colors, with a colored circle and the words " BELT". These shields are drawn as squares with colored circles, with the `ref` values correctly corresponding to the text on the shield. Because of the common design (white shield with colored circle), these shields are properly part of a common route network. Special code is needed to convert the textual ref values to the colors displayed in the shield. - **Branson, MO color-coded routes**. Shields for this system use colors, with a colored rectangle and the words " ROUTE". These shields are drawn as squares with colored rectangles, with the `ref` values correctly corresponding to the text on the shield. Because of the common design (green shield with colored rectangle), these shields are properly part of a common route network. Special code is needed to convert the textual ref values to the colors displayed in the shield. -- Shields with a stacked ref configuration, with `/` separating the two lines of text in the `ref` value. Currently, these `ref` values are displayed verbatim on one line, and the code necessary for stacked ref rendering has not been written yet ([#366](https://github.com/ZeLonewolf/openstreetmap-americana/issues/366)). Such cases include: +- Shields with a stacked ref configuration, with `/` separating the two lines of text in the `ref` value. Currently, these `ref` values are displayed verbatim on one line, and the code necessary for stacked ref rendering has not been written yet ([#366](https://github.com/osm-americana/openstreetmap-americana/issues/366)). Such cases include: - **Italy "Diramazione" (branch) motorways**. Between their main autostrade "A" roads, the Italian motorway network has branch motorways which carry the name of both highways that they connect. For example, the A7 and A26 motorways have a branch motorway named A7/A26, which is correctly tagged `ref=A7/A26` and shown on shields with the two numbers stacked vertically. - **West Virginia County Routes**. The West Virginia Department of Transportation posts County Routes, which can have shields with two stacked numbers. For example, in Mercer County, County Route 460/1 is a branch off U.S. Route 460, and County Route 27/6 is a branch off County Route 27. These routes are correctly tagged `ref=460/1` and `ref=27/6` respectively, and shown on shields with the two numbers stacked vertically. - The [highway classification system of the United Kingdom](https://wiki.openstreetmap.org/wiki/Roads_in_the_United_Kingdom). In the UK, mappers need to and are able to tag the actual official road classifications independently of route networks. The color and style of route signage is based on a strict 1:1 correspondence with the `highway=*` value of the underlying road, and **not** based on M/A/B highway network type. While "M" roads are always motorways with blue route symbology, "A" roads can anything from primary through motorway, and thus may take one of three colors and may change along a single route. Even if mappers were to create route relations containing all roads with the same route number, these relations would not be usable for determining how to render route symbology. Additionally, there are no route concurrencies in the UK; all roads that are `highway=secondary` or higher carry a single `ref` value that can be directly rendered into a shield without pre-processing. There is established data consumers support for this highway classification-based symbology system, most notably OpenMapTiles, which has provided pseudo-network values for UK routes since the project's inception. Therefore, this project consumes the UK pseudo-network scheme established by OpenMapTiles and colors UK route network symbology strictly based on `highway=` consistent with UK signage. @@ -363,16 +363,16 @@ This style strives to draw representative highway shields wherever they are tagg For testing out changes across a variety of different shield designs and ref lengths there is a shield test gallery available: - In local development: http://localhost:1776/shieldtest.html -- On the public demo site: https://zelonewolf.github.io/openstreetmap-americana/shieldtest.html +- On the public demo site: https://americanamap.org/shieldtest.html This aims to display a table of all the unique shield designs in the style with some example refs from 1 to 6 characters. The `networks` and `refs` arrays can be modified for testing with a different set of either: -https://github.com/ZeLonewolf/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L16-L31 -https://github.com/ZeLonewolf/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L203-L218 +https://github.com/osm-americana/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L16-L31 +https://github.com/osm-americana/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L203-L218 To test with a list of all the supported networks in the style this line can be uncommented: -https://github.com/ZeLonewolf/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L200-L201 +https://github.com/osm-americana/openstreetmap-americana/blob/581e1e5d97f5745c1bf764689439d93403888505/src/shieldtest.js#L200-L201 This results in a very long page and can be quite slow or even crash the browser tab. diff --git a/README.md b/README.md index 2c029dfad..101ff6d08 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # OpenStreetMap Americana -_A quintessentially American map style_ [🗺 View the map](https://zelonewolf.github.io/openstreetmap-americana/) +_A quintessentially American map style_ [🗺 View the map](https://americanamap.org/) Americana map style logo -> _The United States of America is such a glorious mess of contradiction, such a crazy quilt of competing themes, such a fecund mishmash of people and ideas, that defining us is pretty much pointless. There is, of course, a kind of faded notion of "Americana", one that concerns Route 66, diners, freak rock formations, and the like—but even in its halcyon days this "roadside attraction" version of America was never an accurate or nuanced distillation of our massively complicated culture._
-Hampton Sides, [Americana: Dispatches from the New Frontier]() (2004) +> _The United States of America is such a glorious mess of contradiction, such a crazy quilt of competing themes, such a fecund mishmash of people and ideas, that defining us is pretty much pointless. There is, of course, a kind of faded notion of "Americana", one that concerns Route 66, diners, freak rock formations, and the like—but even in its halcyon days this "roadside attraction" version of America was never an accurate or nuanced distillation of our massively complicated culture._
-Hampton Sides, [Americana: Dispatches from the New Frontier]() (2004)
@@ -25,9 +25,9 @@ We do this proudly in an open source project using vector tile technology. ## How to use -You can install the OpenStreetMap Americana package and [deploy it anywhere](CONTRIBUTING.md#Production%20builds) as a static webpage. For your convenience, we’ve deployed it [on GitHub Pages](https://zelonewolf.github.io/openstreetmap-americana/). Click the Legend button to learn the meaning of each symbol, line, and color based on the features currently visible on the map. +You can install the OpenStreetMap Americana package and [deploy it anywhere](CONTRIBUTING.md#Production%20builds) as a static webpage. For your convenience, we’ve deployed it [on GitHub Pages](https://americanamap.org/). Click the Legend button to learn the meaning of each symbol, line, and color based on the features currently visible on the map. -The style tries to label places in [your browser’s preferred language](https://www.w3.org/International/questions/qa-lang-priorities). To change this preference, consult your browser’s documentation: [Chrome](https://support.google.com/chrome/answer/173424), [Firefox](https://support.mozilla.org/en-US/kb/use-firefox-another-language), [Safari for macOS](https://support.apple.com/guide/mac-help/change-the-system-language-mh26684/mac), [Safari for iOS](https://support.apple.com/en-us/HT204031). You can also override this preference by adding `&language=` to the URL, followed by a comma-separated list of [IETF language tags](https://www.w3.org/International/articles/language-tags/). For example, here’s a map labeled [in Portuguese, falling back to Spanish](https://zelonewolf.github.io/openstreetmap-americana/#language=pt,es). If we don’t have the name of a place in any of your preferred languages, the style shows the name in the local language as a last resort. +The style tries to label places in [your browser’s preferred language](https://www.w3.org/International/questions/qa-lang-priorities). To change this preference, consult your browser’s documentation: [Chrome](https://support.google.com/chrome/answer/173424), [Firefox](https://support.mozilla.org/en-US/kb/use-firefox-another-language), [Safari for macOS](https://support.apple.com/guide/mac-help/change-the-system-language-mh26684/mac), [Safari for iOS](https://support.apple.com/en-us/HT204031). You can also override this preference by adding `&language=` to the URL, followed by a comma-separated list of [IETF language tags](https://www.w3.org/International/articles/language-tags/). For example, here’s a map labeled [in Portuguese, falling back to Spanish](https://americanamap.org/#language=pt,es). If we don’t have the name of a place in any of your preferred languages, the style shows the name in the local language as a last resort. ## Contributor’s guide @@ -58,9 +58,9 @@ The dynamic shield generator is included as a [module](shieldlib/README.md) in t ## Artifacts -- Style users can use the maplibre [StyleJSON](https://zelonewolf.github.io/openstreetmap-americana/style.json), and sprite sheets ([1x](https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite.png), [2x](https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite@2x.png)). -- For highway shield library users, a [ShieldJSON](https://zelonewolf.github.io/openstreetmap-americana/shields.json) must be supplied to associate route networks with sprite images and drawn shield shapes. -- The project [taginfo.json](https://zelonewolf.github.io/openstreetmap-americana/taginfo.json) lists which tags are used by the style. +- Style users can use the maplibre [StyleJSON](https://americanamap.org/style.json), and sprite sheets ([1x](https://americanamap.org/sprites/sprite.png), [2x](https://americanamap.org/sprites/sprite@2x.png)). +- For highway shield library users, a [ShieldJSON](https://americanamap.org/shields.json) must be supplied to associate route networks with sprite images and drawn shield shapes. +- The project [taginfo.json](https://americanamap.org/taginfo.json) lists which tags are used by the style. ## Data sources @@ -80,8 +80,8 @@ Americana displays custom route shields for routes in all U.S. states and territ Countries -We are hoping that it will support more countries; you can [help us](https://github.com/ZeLonewolf/openstreetmap-americana/projects/1)! +We are hoping that it will support more countries; you can [help us](https://github.com/osm-americana/openstreetmap-americana/projects/1)! ## Tile Server -Although the source code in this repository is dedicated to the public domain under a CC0 waiver, it is configured by default to load map tiles from a privately-donated community [tile server](https://tile.ourmap.us). This server is available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](TILE_USAGE.md) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository. +Although the source code in this repository is dedicated to the public domain under a CC0 waiver, it is configured by default to load map tiles from an [OpenStreetMap US](https://www.openstreetmap.us/) hosted community [tile server](https://tile.ourmap.us). OpenStreetMap US, the local chapter for OpenStreetMap in the United States, makes this server available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](https://tile.ourmap.us/usage.html) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository. diff --git a/TILE_USAGE.md b/TILE_USAGE.md deleted file mode 100644 index 6b818ca57..000000000 --- a/TILE_USAGE.md +++ /dev/null @@ -1,41 +0,0 @@ -# Tile Usage Policy - -Tile Usage Policy for OpenStreetMap Americana Community Vector Tile Server - -**Effective Date: June 12, 2023** - -Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](https://tile.ourmap.us) (referred to as "the Server"). By accessing and using the tiles provided by the Server, you agree to comply with the following Tile Usage Policy: - -1. Purpose: - The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints. - -2. Attribution: - When using tiles from the Server, you must provide proper attribution to [OpenStreetMap](https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines#OpenStreetMap_Attribution_Guideline) and [OpenMapTiles](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md) as required by their respective attribution policies. - -3. Personal and Non-Commercial Use: - The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. Note that this policy only applies to the tile server usage. Anyone is free to use the OSM Americana on their own tile server, even for a commercial endeavor. - -4. Domain Whitelisting: - Tile usage from localhost and \*.github.io is permitted, which are common ways that most developers will access the tile server when starting a new project. If you wish to use the tiles under your own domain name, please contact the Americana team on [Slack](https://osmus.slack.com/archives/C01V02K52UX) (preferred) or [GitHub](https://github.com/ZeLonewolf/openstreetmap-americana) and provide your domain name(s) in order to add your domain to the CORS (Cross-Origin Resource Sharing) white list. This will allow you to fetch tiles directly from your domain. This whitelist is subject to the discretion and may be modified or removed at any time, however, permission is routinely given for community and hobby projects. - -5. Usage Limits: - To ensure fair usage and prevent abuse, the Server may enforce limits on tile requests for individual users or domains. If your usage exceeds reasonable levels or begins to strain the server's resources, the administrator reserves the right to restrict or terminate access to the Server. Users whose usage becomes excessive may be requested to set up their own tile server. - -6. Financial Considerations: - The Server is operated on a limited budget and funded out of pocket by the administrator. While it strives to be freely accessible, financial constraints may necessitate restrictions on usage. If the costs associated with providing tiles become prohibitive, the administrator may need to limit or suspend service temporarily or permanently. Users who can afford to host their own tile server are encouraged to do so. - -7. No Guarantees: - The Server is provided on an "as-is" basis, and no guarantees or warranties are offered regarding its availability, performance, or accuracy of the tiles. The administrator will make reasonable efforts to maintain the service, but interruptions or downtime may occur due to various factors beyond their control. - -8. Modifications and Termination: - The administrator reserves the right to modify or terminate the Server or this Tile Usage Policy at any time without prior notice. The administrator may also modify or update the CORS white list as needed. - -9. Compliance with OpenStreetMap Guidelines: - All users of the Server are expected to comply with the OpenStreetMap licensing terms, guidelines, and community norms. Additionally, the OpenStreetMap Americana project has adopted the OpenStreetMap US Code of Conduct, which applies where applicable. Any violation of these terms may result in the immediate termination of access to the Server. - -10. Feedback and Support: - The administrator appreciates feedback, bug reports, and suggestions to improve the Server via [Slack](https://osmus.slack.com/archives/C01V02K52UX) or [GitHub]. However, support resources may be limited. Users are encouraged to seek assistance from the OpenStreetMap community or other relevant forums for additional support. - -By using the tiles provided by the OpenStreetMap Americana Community Vector Tile Server, you acknowledge and agree to the terms outlined in this Tile Usage Policy. Failure to comply with these terms may result in the revocation of access to the Server. - -Please note that this Tile Usage Policy is subject to change at any time and for any reason. diff --git a/doc-img/shield_map_world.svg b/doc-img/shield_map_world.svg index 08c8d842a..1a8d20598 100644 --- a/doc-img/shield_map_world.svg +++ b/doc-img/shield_map_world.svg @@ -153,6 +153,7 @@ See the end of this file for a list of available jurisdictions and their codes. .cz, .ee, .es, +.fo, .fi, .fr, .de, @@ -179,6 +180,12 @@ See the end of this file for a list of available jurisdictions and their codes. .gb, .au, .nz, +.bl, +.mf, +.nc, +.pf, +.pm, +.wf, .cw, .ust { fill: #8250df; } diff --git a/icons/poi_fire_station.svg b/icons/poi_fire_station.svg new file mode 100644 index 000000000..e31d63c78 --- /dev/null +++ b/icons/poi_fire_station.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_cdmx_eje_central.svg b/icons/shield_mx_cdmx_eje_central.svg new file mode 100644 index 000000000..092346388 --- /dev/null +++ b/icons/shield_mx_cdmx_eje_central.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/icons/shield_mx_cdmx_eje_nte.svg b/icons/shield_mx_cdmx_eje_nte.svg new file mode 100644 index 000000000..d4be2297f --- /dev/null +++ b/icons/shield_mx_cdmx_eje_nte.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_cdmx_eje_ote.svg b/icons/shield_mx_cdmx_eje_ote.svg new file mode 100644 index 000000000..d11aa9d33 --- /dev/null +++ b/icons/shield_mx_cdmx_eje_ote.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_cdmx_eje_pte.svg b/icons/shield_mx_cdmx_eje_pte.svg new file mode 100644 index 000000000..8eb70b599 --- /dev/null +++ b/icons/shield_mx_cdmx_eje_pte.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_cdmx_eje_sur.svg b/icons/shield_mx_cdmx_eje_sur.svg new file mode 100644 index 000000000..617869491 --- /dev/null +++ b/icons/shield_mx_cdmx_eje_sur.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_mx.svg b/icons/shield_mx_mx.svg deleted file mode 100644 index 208fd6a19..000000000 --- a/icons/shield_mx_mx.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/icons/shield_mx_mx_2.svg b/icons/shield_mx_mx_2.svg new file mode 100644 index 000000000..c8056449f --- /dev/null +++ b/icons/shield_mx_mx_2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_mx_3.svg b/icons/shield_mx_mx_3.svg new file mode 100644 index 000000000..86a5478ae --- /dev/null +++ b/icons/shield_mx_mx_3.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_mx_4.svg b/icons/shield_mx_mx_4.svg new file mode 100644 index 000000000..197a0a7d5 --- /dev/null +++ b/icons/shield_mx_mx_4.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_state_2.svg b/icons/shield_mx_state_2.svg new file mode 100644 index 000000000..52a0d58f5 --- /dev/null +++ b/icons/shield_mx_state_2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_mx_state_3.svg b/icons/shield_mx_state_3.svg new file mode 100644 index 000000000..2923349a2 --- /dev/null +++ b/icons/shield_mx_state_3.svg @@ -0,0 +1,4 @@ + + + + diff --git a/icons/shield_us_nht_oreg.svg b/icons/shield_us_nht_oreg.svg new file mode 100644 index 000000000..61434ae90 --- /dev/null +++ b/icons/shield_us_nht_oreg.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/icons/shield_us_nht_ovvi.svg b/icons/shield_us_nht_ovvi.svg new file mode 100644 index 000000000..a0308ec62 --- /dev/null +++ b/icons/shield_us_nht_ovvi.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/icons/shield_us_nht_semo.svg b/icons/shield_us_nht_semo.svg new file mode 100644 index 000000000..b5baff864 --- /dev/null +++ b/icons/shield_us_nht_semo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/package-lock.json b/package-lock.json index 317229671..6a14114c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,42 +11,42 @@ "shieldlib" ], "dependencies": { - "@americana/maplibre-shield-generator": "^0.0.5", + "@americana/maplibre-shield-generator": "*", "color-rgba": "^2.4.0", "events": "^3.3.0", - "fonteditor-core": "^2.4.0", + "fonteditor-core": "^2.1.11", "maplibre-gl": "^2.4.0", "openmapsamples": "github:adamfranco/OpenMapSamples", "openmapsamples-maplibre": "github:adamfranco/OpenMapSamples-MapLibre", "tokenfield": "^1.5.2" }, "devDependencies": { - "@basemaps/sprites": "^7.1.0", + "@basemaps/sprites": "^7.0.0", "@mapbox/vector-tile": "^1.3.1", - "@maplibre/maplibre-gl-style-spec": "^17.1.0", - "@playwright/test": "^1.44.1", - "@types/chai": "^4.3.16", - "@types/color-namer": "^1.3.3", - "@types/mocha": "^10.0.6", - "@types/node": "^20.14.0", + "@maplibre/maplibre-gl-style-spec": "^17.0.1", + "@playwright/test": "^1.38.1", + "@types/chai": "^4.3.4", + "@types/color-namer": "^1.3.0", + "@types/mocha": "^10.0.1", + "@types/node": "^20.8.4", "benchmark": "^2.1.4", - "canvas": "^2.11.2", - "chai": "^4.4.1", + "canvas": "^2.11.0", + "chai": "^4.3.7", "color-namer": "^1.4.0", - "commander": "^10.0.1", - "esbuild": "^0.17.19", - "glob": "^10.4.1", + "commander": "^10.0.0", + "esbuild": "^0.17.4", + "glob": "^10.3.10", "google-font-installer": "^1.2.0", "maplibre-gl": "^2.4.0", - "mocha": "^10.4.0", + "mocha": "^10.1.0", "npm-run-all": "^4.1.5", "open": "^8.4.2", "pbf": "^3.2.1", - "prettier": "^2.8.8", - "sharp": "^0.33.4", + "prettier": "^2.3.2", + "sharp": "^0.33.2", "shx": "^0.3.4", "svgo": "^2.8.0", - "tsx": "^4.11.2", + "tsx": "^4.6.2", "typescript": "^4.9.5" }, "engines": { @@ -6299,22 +6299,23 @@ } }, "shieldlib": { + "name": "@americana/maplibre-shield-generator", "version": "0.0.5", "license": "CC0-1.0", "dependencies": { - "@types/node": "^20.14.0", + "@types/node": "^20.8.4", "color-rgba": "^2.4.0", "maplibre-gl": "^2.4.0", - "mocha": "^10.4.0" + "mocha": "^10.2.0" }, "devDependencies": { - "@types/color-rgba": "^2.1.2", + "@types/color-rgba": "^2.1.0", "canvas": "^2.11.2", - "esbuild": "^0.17.19", + "esbuild": "^0.17.10", "npm-run-all": "^4.1.5", - "prettier": "^2.8.8", + "prettier": "^2.8.4", "shx": "^0.3.4", - "tsx": "^4.11.2", + "tsx": "^4.6.2", "typedoc": "^0.24.8", "typescript": "^4.9.5" } diff --git a/package.json b/package.json index a55d536da..096fcdd1e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "repository": { "type": "git", - "url": "git+https://github.com/zelonewolf/openstreetmap-americana.git" + "url": "git+https://github.com/osm-americana/openstreetmap-americana.git" }, "workspaces": [ "shieldlib" diff --git a/scripts/extract_layer.js b/scripts/extract_layer.js index e6eb4cc3b..420162cb7 100644 --- a/scripts/extract_layer.js +++ b/scripts/extract_layer.js @@ -23,8 +23,8 @@ const locales = opts.locales[0].split(","); const style = Style.build( config.OPENMAPTILES_URL, - "https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite", - "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", + "https://americanamap.org/sprites/sprite", + "https://font.americanamap.org/{fontstack}/{range}.pbf", locales ); diff --git a/scripts/folder_diff.ts b/scripts/folder_diff.ts index 93263faf8..695213f32 100644 --- a/scripts/folder_diff.ts +++ b/scripts/folder_diff.ts @@ -81,7 +81,7 @@ fs.readdirSync(outputFolder) // Add an entry to the markdown table const loc = getLocationByName(basefile); mdContent += - `| ${basefile}
${loc}
[Current Render](https://zelonewolf.github.io/openstreetmap-americana/#map=${loc})` + + `| ${basefile}
${loc}
[Current Render](https://americanamap.org/#map=${loc})` + `
[This PR](${urlBase}#map=${loc}) ` + `| ![Current Render](${urlBase}${outputFolder}/${basefile}_${sha}_before.png) |` + ` ![This PR](${urlBase}${outputFolder}/${basefile}_${sha}_after.png) |\n`; diff --git a/scripts/generate_style.js b/scripts/generate_style.js index 3f097415c..94c04f35a 100644 --- a/scripts/generate_style.js +++ b/scripts/generate_style.js @@ -21,8 +21,8 @@ let opts = program.opts(); let style = Style.build( config.OPENMAPTILES_URL, - "https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite", - "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", + "https://americanamap.org/sprites/sprite", + "https://font.americanamap.org/{fontstack}/{range}.pbf", opts.locales ); diff --git a/scripts/stats.js b/scripts/stats.js index 3644eb238..ef54f91be 100644 --- a/scripts/stats.js +++ b/scripts/stats.js @@ -69,8 +69,8 @@ const distDir = opts.directory; const style = Style.build( config.OPENMAPTILES_URL, - "https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite", - "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", + "https://americanamap.org/sprites/sprite", + "https://font.americanamap.org/{fontstack}/{range}.pbf", locales ); diff --git a/scripts/status_map.js b/scripts/status_map.js index ba50f5327..faa4951c9 100644 --- a/scripts/status_map.js +++ b/scripts/status_map.js @@ -5,6 +5,15 @@ import * as ShieldDef from "../src/js/shield_defs.js"; function fillPaths(svg, codes) { let selectors = new Set(codes.map((code) => `.${code.toLowerCase()}`)); + if (selectors.has(".fr")) { + // French overseas territories use the FR prefix. + selectors.add(".bl"); + selectors.add(".mf"); + selectors.add(".nc"); + selectors.add(".pf"); + selectors.add(".pm"); + selectors.add(".wf"); + } if (selectors.has(".nl")) { // Curaçao routes use NL prefix with the Netherlands. selectors.add(".cw"); diff --git a/scripts/taginfo.js b/scripts/taginfo.js index a0053ee2a..96d14230e 100644 --- a/scripts/taginfo.js +++ b/scripts/taginfo.js @@ -93,7 +93,7 @@ function addNetworkTags(project) { if (!fs.existsSync(save_filename)) { fs.writeFileSync(save_filename, shieldGfx.canvas.toBuffer()); } - icon_url = `https://zelonewolf.github.io/openstreetmap-americana/shield-sample/shield_${network_filename_id}.svg`; + icon_url = `https://americanamap.org/shield-sample/shield_${network_filename_id}.svg`; } else if ( icon !== undefined && (shieldDef.colorLighten !== undefined || @@ -122,9 +122,9 @@ function addNetworkTags(project) { if (!fs.existsSync(save_filename)) { fs.writeFileSync(`${process.cwd()}/${save_filename}`, svgText); } - icon_url = `https://zelonewolf.github.io/openstreetmap-americana/shield-sample/shield_${network_filename_id}.svg`; + icon_url = `https://americanamap.org/shield-sample/shield_${network_filename_id}.svg`; } else { - icon_url = `https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/${icon}.svg`; + icon_url = `https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/${icon}.svg`; } let description = `Roads carrying routes in this network are marked by `; diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 672adcccb..9f332a06e 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -3,9 +3,9 @@ "project": { "name": "OpenStreetMap Americana", "description": "A quintessentially American map style.", - "project_url": "https://github.com/ZeLonewolf/openstreetmap-americana/", + "project_url": "https://github.com/osm-americana/openstreetmap-americana/", "doc_url": "https://wiki.openstreetmap.org/wiki/OpenStreetMap_Americana", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/doc-img/osm-americana-logo.png", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/doc-img/osm-americana-logo.png", "contact_name": "Brian Sperlongano", "contact_email": "zelonewolf@gmail.com" }, @@ -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/ZeLonewolf/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.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/ZeLonewolf/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.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/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" }, { "key": "capital", @@ -45,7 +45,117 @@ "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/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" + }, + { + "key": "capital", + "value": "5", + "object_types": ["node"], + "description": "Marks the place with a local capital icon.", + "doc_url": "https://openmaptiles.org/schema/#capital", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_dot_in_circle.svg" + }, + { + "key": "capital", + "value": "6", + "object_types": ["node"], + "description": "Marks the place with a local capital icon.", + "doc_url": "https://openmaptiles.org/schema/#capital", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_dot_in_circle.svg" + }, + { + "key": "boundary", + "value": "administrative", + "object_types": ["way"], + "description": "Administrative boundaries are marked by dashed lines, with different signatures for each value of admin_level.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "2", + "object_types": ["way"], + "description": "National boundaries are marked by a dashed line with a purple halo.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "3", + "object_types": ["way"], + "description": "National boundaries are marked by a dashed line with a purple halo.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "4", + "object_types": ["way"], + "description": "State boundaries are marked by a dashed line with a purple halo.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "5", + "object_types": ["way"], + "description": "Regional boundaries are marked by a dashed line with a purple halo.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "6", + "object_types": ["way"], + "description": "County boundaries are marked by a dashed line.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "admin_level", + "value": "8", + "object_types": ["way"], + "description": "Municipal boundaries are marked by a dashed line.", + "doc_url": "https://openmaptiles.org/schema/#boundary" + }, + { + "key": "place", + "value": "continent", + "object_types": ["node"], + "description": "Continents are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "country", + "object_types": ["node"], + "description": "Countries are labeled in mixed case.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "state", + "object_types": ["node"], + "description": "States are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "city", + "object_types": ["node"], + "description": "Cities are marked with a dot.", + "doc_url": "https://openmaptiles.org/schema/#place", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_dot.svg" + }, + { + "key": "place", + "value": "town", + "object_types": ["node"], + "description": "Towns are marked with a dot.", + "doc_url": "https://openmaptiles.org/schema/#place", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_dot.svg" + }, + { + "key": "place", + "value": "village", + "object_types": ["node"], + "description": "Villages are marked with a dot.", + "doc_url": "https://openmaptiles.org/schema/#place", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_dot.svg" }, { "key": "disputed", @@ -129,7 +239,7 @@ "object_types": ["node", "area"], "description": "Military air bases are marked by a fighter jet.", "doc_url": "https://openmaptiles.org/schema/#class", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_military_plane.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_military_plane.svg" }, { "key": "aerodrome:type", @@ -144,7 +254,7 @@ "object_types": ["node", "area"], "description": "Military air bases are marked by a fighter jet.", "doc_url": "https://openmaptiles.org/schema/#class", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_military_plane.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_military_plane.svg" }, { "key": "military", @@ -152,7 +262,7 @@ "object_types": ["node", "area"], "description": "Military air bases are marked by a fighter jet.", "doc_url": "https://openmaptiles.org/schema/#class", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_military_plane.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_military_plane.svg" }, { "key": "aerialway", @@ -389,7 +499,7 @@ "object_types": ["node", "area"], "description": "Fuel stations are marked by an icon representing a gas pump.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_fuel.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_fuel.svg" }, { "key": "amenity", @@ -397,7 +507,7 @@ "object_types": ["node", "area"], "description": "Schools are marked by an icon representing a schoolhouse with a triangular flag raised above it.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_school.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_school.svg" }, { "key": "amenity", @@ -405,7 +515,7 @@ "object_types": ["node", "area"], "description": "Taxi stands are marked by an icon representing the front view of a taxi cab.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_taxi.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_taxi.svg" }, { "key": "amenity", @@ -413,7 +523,7 @@ "object_types": ["node", "area"], "description": "Schools are marked by an icon representing a schoolhouse with a triangular flag raised above it.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_school.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_school.svg" }, { "key": "amenity", @@ -421,7 +531,7 @@ "object_types": ["node", "area"], "description": "Colleges are marked by an icon representing a mortarboard cap.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_mortarboard.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_mortarboard.svg" }, { "key": "amenity", @@ -429,7 +539,7 @@ "object_types": ["node", "area"], "description": "Colleges are marked by an icon representing a mortarboard cap.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_mortarboard.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_mortarboard.svg" }, { "key": "amenity", @@ -437,7 +547,7 @@ "object_types": ["node", "area"], "description": "Cafes are marked by an icon representing a coffee cup.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_coffee_cup.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_coffee_cup.svg" }, { "key": "amenity", @@ -445,7 +555,7 @@ "object_types": ["node", "area"], "description": "Bars are marked by an icon representing a martini glass.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_martini_glass.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_martini_glass.svg" }, { "key": "amenity", @@ -453,7 +563,7 @@ "object_types": ["node", "area"], "description": "Bars are marked by an icon representing a martini glass.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_martini_glass.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_martini_glass.svg" }, { "key": "amenity", @@ -461,7 +571,7 @@ "object_types": ["node", "area"], "description": "Hospitals are marked by a white letter 'H' in a blue shield.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_hospital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_hospital.svg" }, { "key": "amenity", @@ -469,7 +579,7 @@ "object_types": ["node", "area"], "description": "Medical offices are marked by a white cross in a blue shield.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_health_cross.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_health_cross.svg" }, { "key": "amenity", @@ -477,7 +587,15 @@ "object_types": ["node", "area"], "description": "Police stations are marked by an icon representing a police badge.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_police_shield.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_police_shield.svg" + }, + { + "key": "amenity", + "value": "fire_station", + "object_types": ["node", "area"], + "description": "Fire stations are marked by an icon representing a firefighter's badge.", + "doc_url": "https://openmaptiles.org/schema/#poi", + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_fire_station.svg" }, { "key": "amenity", @@ -485,7 +603,7 @@ "object_types": ["node", "area"], "description": "City halls are marked by an icon representing a domed building with a rectangular flag raised above it.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_town_hall.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_town_hall.svg" }, { "key": "amenity", @@ -493,7 +611,7 @@ "object_types": ["node", "area"], "description": "Post offices are marked by an icon representing an envelope.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_envelope.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_envelope.svg" }, { "key": "tourism", @@ -501,7 +619,7 @@ "object_types": ["node", "area"], "description": "Guest houses are marked by an icon representing a person laying in a bed.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_hotel.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_hotel.svg" }, { "key": "tourism", @@ -509,7 +627,7 @@ "object_types": ["node", "area"], "description": "Hostels are marked by an icon representing two people laying in a bunk bed.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_hostel.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_hostel.svg" }, { "key": "tourism", @@ -517,7 +635,7 @@ "object_types": ["node", "area"], "description": "Hotels are marked by an icon representing a person laying in a bed.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_hotel.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_hotel.svg" }, { "key": "tourism", @@ -525,7 +643,7 @@ "object_types": ["node", "area"], "description": "Motels are marked by an icon representing a person laying in a bed.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_hotel.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_hotel.svg" }, { "key": "tourism", @@ -533,7 +651,7 @@ "object_types": ["node", "area"], "description": "Museums are marked by an icon representing a Classical columned building.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_museum.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_museum.svg" }, { "key": "amenity", @@ -541,7 +659,7 @@ "object_types": ["node", "area"], "description": "Medical offices are marked by a white cross in a blue shield.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_health_cross.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_health_cross.svg" }, { "key": "amenity", @@ -549,7 +667,7 @@ "object_types": ["node", "area"], "description": "Libraries are marked by an icon representing a book.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_book_upright.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_book_upright.svg" }, { "key": "amenity", @@ -557,7 +675,7 @@ "object_types": ["node", "area"], "description": "Parking lots are marked by a blue letter 'P'.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_p.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_p.svg" }, { "key": "amenity", @@ -565,7 +683,7 @@ "object_types": ["node", "area"], "description": "Places of worship are marked by a square representing a building, topped with a finial representing the religion for common religions.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_generic.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_generic.svg" }, { "key": "amenity", @@ -573,7 +691,7 @@ "object_types": ["node", "area"], "description": "Bus stations are marked by an icon depicting the front of a bus.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_bus.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_bus.svg" }, { "key": "highway", @@ -581,7 +699,7 @@ "object_types": ["node"], "description": "Bus stops are marked by an icon depicting the front of a bus.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_bus.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_bus.svg" }, { "key": "railway", @@ -589,7 +707,7 @@ "object_types": ["node"], "description": "Rail halts are marked by an icon depicting the front of a train.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_rail.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_rail.svg" }, { "key": "railway", @@ -597,7 +715,7 @@ "object_types": ["node", "area"], "description": "Rail stations are marked by an icon depicting the front of a train.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_rail.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_rail.svg" }, { "key": "aerialway", @@ -605,7 +723,7 @@ "object_types": ["node", "area"], "description": "Aerialway stations are marked by an icon depicting an aerial tramway car.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_aerialway_circle.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_aerialway_circle.svg" }, { "key": "railway", @@ -613,7 +731,7 @@ "object_types": ["node"], "description": "Tram stops are marked by an icon depicting the front of a train.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_rail.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_rail.svg" }, { "key": "station", @@ -621,7 +739,7 @@ "object_types": ["node"], "description": "Subway stations are marked by an icon depicting the front of a train.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_rail.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_rail.svg" }, { "key": "religion", @@ -629,7 +747,7 @@ "object_types": ["node", "area"], "description": "Buddhist places of worship are marked by an icon representing a building topped by a dharmachakra.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_buddhist.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_buddhist.svg" }, { "key": "religion", @@ -637,7 +755,7 @@ "object_types": ["node", "area"], "description": "Christian places of worship are marked by an icon representing a building topped by a cross.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_christian.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_christian.svg" }, { "key": "religion", @@ -645,7 +763,7 @@ "object_types": ["node", "area"], "description": "Hindu places of worship are marked by an icon representing a building topped by an om symbol.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_hindu.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_hindu.svg" }, { "key": "religion", @@ -653,7 +771,7 @@ "object_types": ["node", "area"], "description": "Jewish places of worship are marked by an icon representing a building topped by a star of David.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_jewish.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_jewish.svg" }, { "key": "religion", @@ -661,7 +779,7 @@ "object_types": ["node", "area"], "description": "Muslim places of worship are marked by an icon representing a building topped by a star and crescent.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_muslim.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_muslim.svg" }, { "key": "religion", @@ -669,7 +787,7 @@ "object_types": ["node", "area"], "description": "Sikh places of worship are marked by an icon representing a building topped by a khanda.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_sikh.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_sikh.svg" }, { "key": "religion", @@ -677,7 +795,7 @@ "object_types": ["node", "area"], "description": "Shinto places of worship are marked by an icon representing a building topped by a torii.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_shinto.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_shinto.svg" }, { "key": "religion", @@ -685,7 +803,7 @@ "object_types": ["node", "area"], "description": "Taoist places of worship are marked by an icon representing a building topped by a yin-yang symbol.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_pow_taoist.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_pow_taoist.svg" }, { "key": "shop", @@ -693,7 +811,7 @@ "object_types": ["node", "area"], "description": "Bookstores are marked by an icon representing a book.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_book_upright.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_book_upright.svg" }, { "key": "shop", @@ -701,7 +819,7 @@ "object_types": ["node", "area"], "description": "Car dealerships are marked by an icon representing a front facing vehicle.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_car_shop.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_car_shop.svg" }, { "key": "shop", @@ -709,7 +827,7 @@ "object_types": ["node", "area"], "description": "Car mechanic shops are marked by an icon representing a front facing vehicle with a wrench above it.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_car_repair.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_car_repair.svg" }, { "key": "shop", @@ -717,7 +835,7 @@ "object_types": ["node", "area"], "description": "Supermarkets are marked by an icon representing a grocery cart.", "doc_url": "https://openmaptiles.org/schema/#poi", - "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_supermarket.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/poi_supermarket.svg" }, { "key": "highway", diff --git a/shieldlib/README.md b/shieldlib/README.md index fcadf3237..02b1d62fb 100644 --- a/shieldlib/README.md +++ b/shieldlib/README.md @@ -10,7 +10,7 @@ Rendering shields requires the following compoments: 1. **Encode shield information in vector tiles**. First, your tiles must contain the information which tells the shield renderer what shields to draw. In OpenMapTiles, shield information is encoded in the [`transportation_name`](https://openmaptiles.org/schema/#transportation_name) vector tile layer with a series of attributes named `route_1`, `route_2`, etc. Each attribute contains a text string which contains all of the information needed to determine which graphic to display, including numeric route number if the shield is numbered. However, this library allows you to specify how the shield information has been encoded, and it's possible to stitch together data from multiple fields when encoding shield data. -2. **Expose shield information in a style layer**. Next, route information must be exposed in a maplibre expression using [image](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/#types-image) in a structured string containing the route information. For example, you might encode Interstate 95 as an image named `shield|US:I=95`. Normally, the image expression is used to point to pre-designated sprites in a sprite sheet, but in this case, we're pointing to a sprite which doesn't exist called `shield|US:I=95`. This will trigger a `styleimagemissing` event which allows the shield renderer to create the required graphic on the fly. As an example of how to encode shield information, see OSM Americana's [`highway_shield`](https://github.com/ZeLonewolf/openstreetmap-americana/blob/main/src/layer/highway_shield.js) style layer. +2. **Expose shield information in a style layer**. Next, route information must be exposed in a maplibre expression using [image](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/#types-image) in a structured string containing the route information. For example, you might encode Interstate 95 as an image named `shield|US:I=95`. Normally, the image expression is used to point to pre-designated sprites in a sprite sheet, but in this case, we're pointing to a sprite which doesn't exist called `shield|US:I=95`. This will trigger a `styleimagemissing` event which allows the shield renderer to create the required graphic on the fly. As an example of how to encode shield information, see OSM Americana's [`highway_shield`](https://github.com/osm-americana/openstreetmap-americana/blob/main/src/layer/highway_shield.js) style layer. 3. **Define a parser that describes how route information is encoded**. There are three parts to a route definition: @@ -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. @@ -323,4 +328,4 @@ In addition to the stock drawing functions, a custom draw function can be specif ## Documentation -See [TypeDoc generated documentation](https://zelonewolf.github.io/openstreetmap-americana/shield-docs/index.html) for detailed API information. +See [TypeDoc generated documentation](https://americanamap.org/shield-docs/index.html) for detailed API information. diff --git a/shieldlib/package.json b/shieldlib/package.json index 552bc910a..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.5", + "version": "0.0.7", "author": "OpenStreetMap Americana Contributors", "type": "module", "keywords": [ @@ -41,12 +41,12 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/ZeLonewolf/openstreetmap-americana.git" + "url": "git+https://github.com/osm-americana/openstreetmap-americana.git" }, "bugs": { - "url": "https://github.com/ZeLonewolf/openstreetmap-americana/issues" + "url": "https://github.com/osm-americana/openstreetmap-americana/issues" }, - "homepage": "https://github.com/ZeLonewolf/openstreetmap-americana#readme", + "homepage": "https://github.com/osm-americana/openstreetmap-americana#readme", "dependencies": { "@types/node": "^20.8.4", "color-rgba": "^2.4.0", diff --git a/shieldlib/src/shield.ts b/shieldlib/src/shield.ts index 8eada1a6a..fcbe1c82b 100644 --- a/shieldlib/src/shield.ts +++ b/shieldlib/src/shield.ts @@ -15,6 +15,7 @@ import { TextPlacement } from "./shield_text"; import { StyleImage } from "maplibre-gl"; const narrowCharacters = /[1IJijl .-]/g; +const maxRefLength = 7; function compoundShieldSize( r: ShieldRenderingContext, @@ -30,7 +31,7 @@ function compoundShieldSize( } export function isValidRef(ref: string): boolean { - return ref !== null && ref.length !== 0 && ref.length <= 6; + return ref !== null && ref.length !== 0 && ref.length <= maxRefLength; } /** diff --git a/shieldlib/src/shield_renderer.ts b/shieldlib/src/shield_renderer.ts index 87f72cb55..626b7cabc 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,30 @@ 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 b008a5cea..ba29fc651 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/fonts.css b/src/fonts.css index 89471403c..d21abb24f 100644 --- a/src/fonts.css +++ b/src/fonts.css @@ -1,8 +1,8 @@ @font-face { font-family: "Noto Sans Condensed"; - src: url("https://osm-americana.github.io/web-fonts/noto/NotoSans-CondensedMedium-PropNums.woff2") + src: url("https://webfont.americanamap.org/noto/NotoSans-CondensedMedium-PropNums.woff2") format("woff2"), - url("https://osm-americana.github.io/web-fonts/noto/NotoSans-CondensedMedium-PropNums.woff") + url("https://webfont.americanamap.org/noto/NotoSans-CondensedMedium-PropNums.woff") format("woff"); font-weight: 500; font-style: normal; @@ -10,9 +10,9 @@ } @font-face { font-family: "Noto Sans Armenian Condensed"; - src: url("https://osm-americana.github.io/web-fonts/noto/NotoSansArmenian-CondensedMedium-PropNums.woff2") + src: url("https://webfont.americanamap.org/noto/NotoSansArmenian-CondensedMedium-PropNums.woff2") format("woff2"), - url("https://osm-americana.github.io/web-fonts/noto/NotoSansArmenian-CondensedMedium-PropNums.woff") + url("https://webfont.americanamap.org/noto/NotoSansArmenian-CondensedMedium-PropNums.woff") format("woff"); font-weight: 500; font-style: normal; diff --git a/src/index.html b/src/index.html index fff7f541d..51b69f7d6 100644 --- a/src/index.html +++ b/src/index.html @@ -100,7 +100,7 @@
- + (shields[`MX:${state}`] = { + spriteBlank: ["shield_mx_state_2", "shield_mx_state_3"], + textColor: Color.shields.black, + padding: { + left: 2, + right: 2, + top: 5.5, + bottom: 4.5, + }, + }) + ); + + // Ejes Viales (CDMX) + shields["MX:CDMX:EJE:CENTRAL"] = { + noref: { + spriteBlank: "shield_mx_cdmx_eje_central", + }, + }; + shields["MX:CDMX:EJE:NTE"] = { + spriteBlank: "shield_mx_cdmx_eje_nte", padding: { left: 2, right: 2, - top: 3, + top: 8, bottom: 2, }, }; + shields["MX:CDMX:EJE:OTE"] = { + spriteBlank: "shield_mx_cdmx_eje_ote", + padding: { + left: 2, + right: 8, + top: 2, + bottom: 2, + }, + }; + shields["MX:CDMX:EJE:PTE"] = { + spriteBlank: "shield_mx_cdmx_eje_pte", + padding: { + left: 8, + right: 2, + top: 2, + bottom: 2, + }, + }; + shields["MX:CDMX:EJE:SUR"] = { + spriteBlank: "shield_mx_cdmx_eje_sur", + padding: { + left: 2, + right: 2, + top: 2, + bottom: 8, + }, + }; // United States @@ -560,15 +649,16 @@ export function loadShields() { top: 6, bottom: 5, }, + bannerMap: { + "US:I:Alternate": ["ALT"], + "US:I:Express": ["EXPR"], + "US:I:Express:Toll": ["EXPR"], + "US:I:Future": ["FUT"], + "US:I:Spur": ["SPUR"], + "US:I:Truck": ["TRK"], + }, }; - shields["US:I:Alternate"] = banneredShield(shields["US:I"], ["ALT"]); - shields["US:I:Future"] = banneredShield(shields["US:I"], ["FUT"]); - shields["US:I:Spur"] = banneredShield(shields["US:I"], ["SPUR"]); - 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: [ @@ -582,48 +672,31 @@ export function loadShields() { shields["US:I:Downtown:Spur"] = shields["US:I:Business:Spur"]; // 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"] = { + ...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( - { + shields["US:US:Historic"] = + ({ ...badgeShieldCrossbar, textColor: Color.shields.brown, colorLighten: Color.shields.brown, }, ["HIST"], - Color.shields.brown - ); + Color.shields.brown); // US Federal Agencies @@ -652,6 +725,21 @@ export function loadShields() { spriteBlank: "shield_us_nps_ntp", }, }; + shields["US:NHT"] = { + notext: true, + overrideByName: { + "Oregon National Historic Trail Auto Tour Route": { + spriteBlank: "shield_us_nht_oreg", + }, + "Overmountain Victory National Historic Trail Commemorative Motor Route": + { + spriteBlank: "shield_us_nht_ovvi", + }, + "Selma to Montgomery National Historic Trail": { + spriteBlank: "shield_us_nht_semo", + }, + }, + }; // Other multistate routes @@ -705,8 +793,11 @@ export function loadShields() { top: 3, bottom: 6, }, + bannerMap: { + "US:AL:Truck": ["TRK"], + }, }; - shields["US:AL:Truck"] = banneredShield(shields["US:AL"], ["TRK"]); + [ "Autauga", "Baldwin", @@ -885,10 +976,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( @@ -913,12 +1007,10 @@ export function loadShields() { top: 6, bottom: 4, }, + bannerMap: { + "US:CA:Business": ["BUS"], + }, }; - shields["US:CA:Business"] = banneredShield( - shields["US:CA"], - ["BUS"], - Color.shields.green - ); ["CR", "Sierra"].forEach( (county) => (shields[`US:CA:${county}`] = pentagonUpShield( @@ -1033,10 +1125,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"] = { @@ -1064,13 +1160,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"] = { @@ -1082,6 +1187,15 @@ 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"], + }, overrideByRef: { 515: { textColor: Color.shields.blue, @@ -1093,16 +1207,6 @@ export function loadShields() { }, }, }; - 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"] = { @@ -1139,8 +1243,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( @@ -1261,8 +1367,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, @@ -1293,10 +1404,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", @@ -1351,9 +1465,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"], @@ -1365,29 +1481,35 @@ 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, }; // Michigan - shields["US:MI"] = diamondShield(Color.shields.white, Color.shields.black); - shields["US:MI"].overrideByRef = { - 185: diamondShield( - Color.shields.brown, - Color.shields.white, - Color.shields.white, - 0, - 24 - ), + shields["US:MI"] = { + ...diamondShield(Color.shields.white, Color.shields.black), + bannerMap: { + "US:MI:Business": ["BUS"], + "US:MI:Connector": ["CONN"], + }, + overrideByRef: { + 185: diamondShield( + Color.shields.brown, + Color.shields.white, + Color.shields.white, + 0, + 24 + ), + }, }; - 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( (county) => (shields[`US:MI:${county}`] = pentagonUpShield( @@ -1570,18 +1692,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", @@ -1684,16 +1806,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, @@ -1711,11 +1837,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", @@ -1773,16 +1901,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, @@ -1798,8 +1926,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, overrideByName: { @@ -1819,12 +1949,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, @@ -1976,8 +2105,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:Inner_Loop"] = { ...trapezoidDownShield( 10, @@ -2112,9 +2243,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, @@ -2324,12 +2457,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, @@ -2346,8 +2481,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( @@ -2368,10 +2505,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, @@ -2432,33 +2571,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"] = { @@ -2470,9 +2596,11 @@ export function loadShields() { top: 3, bottom: 5, }, + bannerMap: { + "US:SD:Business": ["BUS"], + "US:SD:Truck": ["TRK"], + }, }; - 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 @@ -2553,32 +2681,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, @@ -2587,17 +2703,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, @@ -2608,8 +2725,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"], @@ -2619,38 +2738,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, @@ -2770,15 +2883,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 @@ -2797,17 +2914,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); @@ -2823,10 +2935,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, @@ -2843,9 +2957,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", @@ -2926,10 +3042,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, @@ -3262,8 +3377,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( @@ -3570,6 +3687,14 @@ export function loadShields() { Color.shields.white ); + // Faroe Islands + shields["FO"] = roundedRectShield( + Color.shields.white, + Color.shields.black, + Color.shields.black, + 34 + ); + // Finland // Valtatie/riksväg shields["fi:national"] = roundedRectShield( @@ -3593,10 +3718,56 @@ export function loadShields() { ); // France - shields["FR:A-road"] = shields["FR:N-road"] = roundedRectShield( - Color.shields.red, - Color.shields.white + // Autoroutes/national routes + shields["FR:A-road"] = + shields["FR:N-road"] = + shields["FR:971:N-road"] = + shields["FR:972:A-road"] = + shields["FR:972:N-road"] = + shields["FR:973:N-road"] = + shields["FR:974:N-road"] = + shields["FR:975:N-road"] = + shields["FR:976:N-road"] = + shields["FR:978:N-road"] = + shields["FR:986:RT-road"] = + shields["FR:987:RT-road"] = + shields["FR:988:VE-road"] = + shields["FR:988:RT-road"] = + roundedRectShield(Color.shields.red, Color.shields.white); + // Departmental routes + // compute list of French department INSEE codes, 01 through 95, inclusive + let departments = Array.from({ length: 95 }, (_, i) => + (i + 1).toString().padStart(2, "0") + ); + [...departments, "971", "972", "973", "974", "976", "977", "978"].forEach( + (department) => { + shields[`FR:${department}:D-road`] = roundedRectShield( + Color.shields.yellow, + Color.shields.black + ); + } ); + // Metropolitan routes + [ + "06", + "21", + "31", + "34", + "37", + "42", + "44", + "54", + "57", + "59", + "63", + "67", + "69", + ].forEach((department) => { + shields[`FR:${department}:M-road`] = roundedRectShield( + Color.shields.blue, + Color.shields.white + ); + }); // Germany shields["DE:national"] = roundedRectShield( diff --git a/src/js/shield_format.ts b/src/js/shield_format.ts index 10368bbf5..3776b032d 100644 --- a/src/js/shield_format.ts +++ b/src/js/shield_format.ts @@ -11,7 +11,7 @@ export const shieldPredicate: StringPredicate = (imageID: string) => export const networkPredicate: StringPredicate = (network: string) => // On recreational route relations, network=* indicates the network's scope, // not the network itself. - // https://github.com/ZeLonewolf/openstreetmap-americana/issues/94 + // https://github.com/osm-americana/openstreetmap-americana/issues/94 !/^[lrni][chimpw]n$/.test(network); export const routeParser: RouteParser = { diff --git a/src/layer/poi.js b/src/layer/poi.js index d9a5ddbcc..8fc48fc6b 100644 --- a/src/layer/poi.js +++ b/src/layer/poi.js @@ -83,6 +83,14 @@ var iconDefs = { color: Color.poi.consumer, description: "Gas station", }, + fire_station: { + classes: { + fire_station: ["fire_station"], + }, + sprite: "poi_fire_station", + color: Color.poi.infrastructure, + description: "Fire station", + }, hospital: { classes: { hospital: ["hospital"], @@ -342,6 +350,7 @@ export const poi = { Color.poi.attraction, [ "hospital", + "fire_station", "parking", "police", "school", @@ -376,6 +385,7 @@ export const poi = { 14, [ "bus_stop", + "fire_station", "hospital", "library", "museum", diff --git a/src/layer/road_label.js b/src/layer/road_label.js index c820b8631..82a419824 100644 --- a/src/layer/road_label.js +++ b/src/layer/road_label.js @@ -144,7 +144,7 @@ export const smallService = { }; // A spacer label on each bridge to push any waterway label away from the bridge. -// https://github.com/ZeLonewolf/openstreetmap-americana/issues/198 +// https://github.com/osm-americana/openstreetmap-americana/issues/198 export const bridgeSpacer = { id: "bridge_spacer", type: "symbol", diff --git a/src/layer/transportation_label.js b/src/layer/transportation_label.js index 45b3f30f3..f838c78fc 100644 --- a/src/layer/transportation_label.js +++ b/src/layer/transportation_label.js @@ -166,7 +166,7 @@ export const label = { }; // A spacer label on each bridge to push any waterway label away from the bridge. -// https://github.com/ZeLonewolf/openstreetmap-americana/issues/198 +// https://github.com/osm-americana/openstreetmap-americana/issues/198 export const bridgeSpacer = { id: "bridge_spacer", type: "symbol", diff --git a/src/shieldtest.html b/src/shieldtest.html index 164891c8e..8a64cf541 100644 --- a/src/shieldtest.html +++ b/src/shieldtest.html @@ -37,7 +37,7 @@ Network - Graphic + Graphic Performance diff --git a/src/shieldtest.js b/src/shieldtest.js index 26b052058..c46d52bed 100644 --- a/src/shieldtest.js +++ b/src/shieldtest.js @@ -121,6 +121,7 @@ let networks = [ "US:VA", "US:PR:primary", "HK", + "MX:QRO", "CA:QC:A", "NZ:SH", @@ -135,6 +136,7 @@ let networks = [ "CA:PE", "US:FL:Toll", "CA:BC", + "MX:MX", "IN:NH", "PK:motorway", "US:US", @@ -259,6 +261,8 @@ let refs = [ "A 562", "1138-2", "A26/A7", + "GUA 10D", + "SS18var", ]; export function getShieldCanvas(network, ref, name) { diff --git a/test/spec/shield.js b/test/spec/shield.js index 29beb569d..472aba34c 100644 --- a/test/spec/shield.js +++ b/test/spec/shield.js @@ -27,8 +27,8 @@ const handler = shieldRenderer.getStyleImageMissingHandler(); handler({ id: "shield\nBAB\n5\n\n" }); handler({ id: "shield\nUS:RI\n\n\n" }); -handler({ id: "shield\nUS:RI\nABC123\n\n" }); -handler({ id: "shield\nUS:RI\nEquator\n\n" }); +handler({ id: "shield\nUS:RI\nABC1234\n\n" }); +handler({ id: "shield\nUS:RI\nLatitude\n\n" }); handler({ id: "shield\nrwn\n\n\n" }); handler({ id: "foo" }); @@ -51,9 +51,9 @@ describe("shield", function () { expect(isBlankSprite("shield\nUS:RI\n\n\n")).to.be.true; }); it("rejects a long ref", function () { - expect(mockRepo.hasSprite("shield\nUS:RI\nABC123\n\n")).to.be.true; - expect(isBlankSprite("shield\nUS:RI\nABC123\n\n")).to.be.false; - expect(isBlankSprite("shield\nUS:RI\nEquator\n\n")).to.be.true; + expect(mockRepo.hasSprite("shield\nUS:RI\nABC1234\n\n")).to.be.true; + expect(isBlankSprite("shield\nUS:RI\nABC1234\n\n")).to.be.false; + expect(isBlankSprite("shield\nUS:RI\nLatitude\n\n")).to.be.true; }); }); });