Repository navigation
Development
Deutsch: Entwicklung
| File | Purpose |
|---|---|
manifest.json |
Manifest V3, runs on openstreetmap.org only, permission storage
|
settings.js |
Settings, road classes, country rules, town signs – shared by popup, bridge and map |
bridge.js |
Isolated world: reads chrome.storage, sends settings and tables to the map script |
content.js |
Page world: rules, country lookup, colouring, icons, panel, tag text box |
popup.html, popup.js
|
The settings popup |
generated/signs.js, generated/regions.js
|
Sign artwork and Belgian region borders, written by the build scripts, loaded before content.js
|
dev/test.js |
Tests for rules, tag text and geography |
dev/signs/ |
Motorway signs (Wikimedia Commons, public domain) and own neutral symbols |
dev/icon/ |
Source of the toolbar icon |
content.js runs in the page's own world (world: "MAIN") because iD keeps each way's data
on its SVG element (path.__data__), which only scripts in that world can read.
node dev/test.js
node --check content.jsThe scripts are also type-checked with tsc --checkJs --strict
(--target es2022 --lib es2022,dom,dom.iterable) and linted with ESLint 9 (no Prettier: the
dense tables stay as written).
-
Sign artwork – after changing
dev/signs/*.svg:node dev/build-signs.jswritesgenerated/signs.js. -
Belgian region borders –
node dev/build-regions.jsfetches Flanders (relation 53134) and Brussels-Capital (54094) from the Overpass API, simplifies them to 20 m and writes them intogenerated/regions.js(© OpenStreetMap contributors, ODbL). A saved Overpass answer can be passed as argument.
The manifest loads both files right before content.js; they leave their data on one global,
which content.js takes and removes at once.
-
Icons –
node dev/build-icons.jsrendersicons/*.pngfromdev/icon/with headless Chrome.
The values live in OZT_COUNTRIES / OZT_UNVERIFIED in settings.js. Before a country
becomes verified or gets the editor, check the OSM wiki page
Key:zone:traffic and the values
actually used on taginfo, and
update OZT_SOURCE.
OSM Traffic Zone Inspector · Repository · Releases · Issues · Code: MIT · Motorway signs: public domain · Belgian region borders: © OpenStreetMap contributors, ODbL