Skip to content

Commit

Permalink
Merge branch 'main' into clay-shields-mx-mx-widen
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeLonewolf authored Jun 20, 2024
2 parents 2e9a9ea + 43d5784 commit a7f5d0e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 27 deletions.
7 changes: 7 additions & 0 deletions doc-img/shield_map_world.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 25 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions scripts/status_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
60 changes: 57 additions & 3 deletions src/js/shield_defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3614,6 +3614,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(
Expand All @@ -3637,10 +3645,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(
Expand Down

0 comments on commit a7f5d0e

Please sign in to comment.