@map-jr/styles 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/NOTICE.md +16 -0
- package/README.md +353 -2
- package/dist/maplibre/elevation-radar.min.json +1 -0
- package/dist/maplibre/elevation-zero.min.json +1 -0
- package/dist/maplibre/elevation.min.json +1 -0
- package/dist/styles/elevation-radar.min.json +1 -0
- package/dist/styles/elevation-zero.min.json +1 -0
- package/dist/styles/elevation.min.json +1 -0
- package/dist/styles/openfreemap-bright.min.json +1 -0
- package/dist/styles/openfreemap-dark.min.json +1 -0
- package/dist/styles/openfreemap-fiord.min.json +1 -0
- package/dist/styles/openfreemap-liberty.min.json +1 -0
- package/dist/styles/openfreemap-positron.min.json +1 -0
- package/icons/extra/LICENSE-maki.txt +116 -0
- package/icons/upstream/LICENSE-bright.md +62 -0
- package/icons/upstream/LICENSE-liberty.md +38 -0
- package/package.json +71 -4
- package/styles/src/openfreemap/COMMIT +1 -0
- package/styles/src/openfreemap/LICENSE-bright.md +62 -0
- package/styles/src/openfreemap/LICENSE-dark.md +62 -0
- package/styles/src/openfreemap/LICENSE-fiord.md +62 -0
- package/styles/src/openfreemap/LICENSE-liberty.md +38 -0
- package/styles/src/openfreemap/LICENSE-positron.md +62 -0
- package/styles/src/openfreemap/LICENSE.md +65 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Each version has one entry. The styles are served at `https://styles.map-jr.org/<major>/`, so a version that breaks a
|
|
4
|
+
map increases the first number, and its entry starts with a section "Breaking changes". Every other version
|
|
5
|
+
increases the second number. The third number is always 0. See [Release](README.md#release).
|
|
6
|
+
|
|
7
|
+
## 1.1.0 (2026-11-19)
|
|
8
|
+
|
|
9
|
+
- Elevation · color is renamed Elevation: `elevation-color.json` is now `elevation.json`, with the same layers. The
|
|
10
|
+
old name is gone.
|
|
11
|
+
- Elevation · zero (`elevation-zero.json`): Elevation without the elevation tiles. It has no hillshade, no 3D terrain
|
|
12
|
+
and no labels of peaks, and keeps the shaded relief of Natural Earth at low zooms.
|
|
13
|
+
- Elevation · radar: the global state `relief` (`true` by default) switches off the hillshade and the labels of
|
|
14
|
+
peaks. map-jr-gl reads a global state in `visibility` after 0.8.0
|
|
15
|
+
([map-jr/map-jr-gl#998](https://github.com/map-jr/map-jr-gl/issues/998)); MapLibre GL JS from 5.16.0.
|
|
16
|
+
- MapLibre styles: Elevation, Elevation · zero and Elevation · radar for MapLibre GL JS 5.16.0 or later, at
|
|
17
|
+
`/1/maplibre/<name>.json` and `@map-jr/styles/maplibre/<name>.json`. They have the same layers and global state,
|
|
18
|
+
with the icons in a sprite (`/1/maplibre/sprite`) in the colors of each branch, and the Noto Sans glyphs of
|
|
19
|
+
OpenFreeMap in place of the fonts of the system. See [MapLibre GL JS](README.md#maplibre-gl-js).
|
|
20
|
+
- Each style has `metadata["map-jr:ssr"]`, for the first view that the server renderer of map-jr-gl writes: a
|
|
21
|
+
placeholder, like a blurred image while the map loads. It keeps the background, the large areas, the water, the
|
|
22
|
+
main roads, the borders and the names of places, and leaves out the rest. With `tileZoomOffset: 2` (map-jr-gl
|
|
23
|
+
after 0.8.0) it is 4 to 12 KB with gzip in most views, 86% smaller than without it. The map in the browser and
|
|
24
|
+
MapLibre GL JS ignore it. See [Server render](README.md#how-it-is-made).
|
|
25
|
+
|
|
26
|
+
## 1.0.0 (2026-11-18)
|
|
27
|
+
|
|
28
|
+
The first release at `https://styles.map-jr.org/1/`.
|
|
29
|
+
|
|
30
|
+
- The styles Elevation · color, Elevation · radar, and the five styles of OpenFreeMap, each as one JSON file without
|
|
31
|
+
white space, with its icons and road shields inside it.
|
|
32
|
+
- The two elevation styles draw their labels with the fonts of the system and load no glyph files. They need a
|
|
33
|
+
map-jr-gl with commit `bd4d4ea`. MapLibre GL JS does not load them.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sam Margulies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Third-party material
|
|
2
|
+
|
|
3
|
+
The MIT licence in `LICENSE` covers what is written for this repository: the build (`build.mjs`, `lib/`, `scripts/`,
|
|
4
|
+
`test/`), the style modules (`styles/*.mjs`) and the shield templates (`shields/*.svg`, `shields/shields.mjs`).
|
|
5
|
+
The material below comes from other projects and keeps its own terms. `dist/` is built from both.
|
|
6
|
+
|
|
7
|
+
| Material | From | Terms |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `icons/upstream/*.svg` | [openfreemap-styles](https://github.com/hyperknot/openfreemap-styles), the liberty and bright icon sets | `icons/upstream/LICENSE-liberty.md`, `icons/upstream/LICENSE-bright.md` |
|
|
10
|
+
| `icons/extra/*.svg` | Glyphs of [Maki](https://github.com/mapbox/maki), on the disc of the sprite icons | CC0 1.0: `icons/extra/LICENSE-maki.txt` |
|
|
11
|
+
| `styles/src/openfreemap/*.json` | [openfreemap-styles](https://github.com/hyperknot/openfreemap-styles), at the commit in `styles/src/openfreemap/COMMIT` | BSD 3-Clause for the style code and CC-BY 4.0 for the design: `styles/src/openfreemap/LICENSE*.md` |
|
|
12
|
+
| `styles/src/elevation.json` | Based on [OSM Liberty](https://github.com/maputnik/osm-liberty), with the tiles and the sprite of OpenFreeMap | BSD 3-Clause for the style code and CC-BY 4.0 for the design, as `styles/src/openfreemap/LICENSE-liberty.md` |
|
|
13
|
+
| `styles/src/elevation-radar.json` | Based on a style of the OpenMapTiles family; the closest is [MapTiler Basic](https://github.com/openmaptiles/maptiler-basic-gl-style) | BSD 3-Clause for the style code and CC-BY 4.0 for the design |
|
|
14
|
+
| `shields/networks.json` | Made from the shield definitions of [OSM Americana](https://github.com/osm-americana/openstreetmap-americana) (`https://americanamap.org/shields.json`) | CC0 1.0 |
|
|
15
|
+
|
|
16
|
+
Map data shown with the styles: OpenFreeMap, © OpenMapTiles, data from OpenStreetMap; terrain © Mapterhorn.
|
package/README.md
CHANGED
|
@@ -1,3 +1,354 @@
|
|
|
1
|
-
#
|
|
1
|
+
# map-jr-styles
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Map styles for [map-jr-gl](https://github.com/map-jr/map-jr-gl) that carry their own icons and road shields as SVG
|
|
4
|
+
templates, in place of a sprite sheet, and versions of the elevation styles for
|
|
5
|
+
[MapLibre GL JS](https://maplibre.org/maplibre-gl-js/). Each elevation style has a light and a dark branch, chosen by
|
|
6
|
+
the global state property `color-scheme`.
|
|
7
|
+
|
|
8
|
+
## The styles
|
|
9
|
+
|
|
10
|
+
Pass a link as the `style` of the map. Each one is the latest release of version 1.
|
|
11
|
+
|
|
12
|
+
| Style | map-jr-gl | MapLibre GL JS 5.16+ | What it is |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| Elevation | [elevation.json](https://styles.map-jr.org/1/elevation.json) | [maplibre/elevation.json](https://styles.map-jr.org/1/maplibre/elevation.json) | A full-color terrain map. Dark is the same map under bright moonlight. |
|
|
15
|
+
| Elevation · zero | [elevation-zero.json](https://styles.map-jr.org/1/elevation-zero.json) | [maplibre/elevation-zero.json](https://styles.map-jr.org/1/maplibre/elevation-zero.json) | Elevation without the elevation tiles: no hillshade, no 3D terrain, no labels of peaks. It keeps the shaded relief of Natural Earth at low zooms. |
|
|
16
|
+
| Elevation · radar | [elevation-radar.json](https://styles.map-jr.org/1/elevation-radar.json) | [maplibre/elevation-radar.json](https://styles.map-jr.org/1/maplibre/elevation-radar.json) | A neutral base for an overlay (a choropleth, snowfall), with relief and peaks for context, which the global state `relief` switches off. |
|
|
17
|
+
| OpenFreeMap Bright | [openfreemap-bright.json](https://styles.map-jr.org/1/openfreemap-bright.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/bright) | The styles of OpenFreeMap as they are, with the images of the sprite inside the style. For MapLibre, use the styles of OpenFreeMap itself. |
|
|
18
|
+
| OpenFreeMap Dark | [openfreemap-dark.json](https://styles.map-jr.org/1/openfreemap-dark.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/dark) | 〃 |
|
|
19
|
+
| OpenFreeMap Fiord | [openfreemap-fiord.json](https://styles.map-jr.org/1/openfreemap-fiord.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/fiord) | 〃 |
|
|
20
|
+
| OpenFreeMap Liberty | [openfreemap-liberty.json](https://styles.map-jr.org/1/openfreemap-liberty.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/liberty) | 〃 |
|
|
21
|
+
| OpenFreeMap Positron | [openfreemap-positron.json](https://styles.map-jr.org/1/openfreemap-positron.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/positron) | 〃 |
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
createMap('map', {style: 'https://styles.map-jr.org/1/elevation.json'}); // map-jr-gl
|
|
25
|
+
new maplibregl.Map({container: 'map', style: 'https://styles.map-jr.org/1/maplibre/elevation.json'}); // MapLibre GL JS
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The same styles are in the npm package [`@map-jr/styles`](#from-npm): `@map-jr/styles/<name>.json` and
|
|
29
|
+
`@map-jr/styles/maplibre/<name>.json`. In this repository they are built to `dist/styles/` and `dist/maplibre/`.
|
|
30
|
+
|
|
31
|
+
Each style also has a `.min.json` without white space. The styles need a map-jr-gl build that reads
|
|
32
|
+
`metadata["map-jr:images"]` and `params` of the `image` expression. MapLibre GL JS draws them without icons: use the
|
|
33
|
+
MapLibre styles for it ([below](#maplibre-gl-js)).
|
|
34
|
+
|
|
35
|
+
The three elevation styles have no `glyphs`: map-jr-gl draws their labels with the fonts of the browser, and makes no
|
|
36
|
+
requests for fonts. Each `text-font` is a stack of the fonts of the system, such as
|
|
37
|
+
`["system-ui Semibold", "Segoe UI Semibold", "Roboto Medium", "sans-serif"]`: SF Pro on Apple systems, Segoe UI on
|
|
38
|
+
Windows, Roboto on Android. The first name gives the weight and the style (Regular, Semibold, Bold, Italic, Semibold
|
|
39
|
+
Italic). This needs a map-jr-gl with commit `bd4d4ea` (a `text-font` stack as a CSS family list, with `system-ui`
|
|
40
|
+
unquoted); an older one draws the labels in the `fontFamily` of the map. To give every reader the same font, pass the
|
|
41
|
+
font files in the `fonts` option of map-jr-gl. MapLibre GL JS does not load a style
|
|
42
|
+
with text and no `glyphs`: its versions of these three styles have the glyphs of OpenFreeMap. The OpenFreeMap styles
|
|
43
|
+
keep the glyphs of OpenFreeMap.
|
|
44
|
+
|
|
45
|
+
## Use
|
|
46
|
+
|
|
47
|
+
The styles are at `https://styles.map-jr.org`, by major version:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
createMap('map', {style: 'https://styles.map-jr.org/1/elevation.json'});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
| Path | What it gives | Cached |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `/1/<name>.json` | The latest release of version 1, without white space. It takes each change that does not break a map. | A day in the browser, then up to a week more while it is fetched again in the background; 5 minutes at the edge |
|
|
56
|
+
| `/1/version.json` | `{version, commit}` of the folder | As its folder |
|
|
57
|
+
|
|
58
|
+
A new major version (`/2/`) breaks a map: a layer id is renamed or removed, a global state property changes, or the
|
|
59
|
+
styles need a newer map-jr-gl. Every other release is a new minor version (`1.1`), and `/1/` moves to it. To keep
|
|
60
|
+
one release as it is, host the zip of its GitHub release.
|
|
61
|
+
|
|
62
|
+
### MapLibre GL JS
|
|
63
|
+
|
|
64
|
+
The three elevation styles have a version for [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/) 5.16.0 or later,
|
|
65
|
+
with the same layers, sources and global state:
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
new maplibregl.Map({container: 'map', style: 'https://styles.map-jr.org/1/maplibre/elevation.json'});
|
|
69
|
+
map.setGlobalStateProperty('color-scheme', 'dark');
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
| Path | What it is |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `/1/maplibre/{elevation,elevation-zero,elevation-radar}.json` | The style, without white space. |
|
|
75
|
+
| `/1/maplibre/sprite.json`, `sprite.png`, `sprite@2x.json`, `sprite@2x.png` | The sprite that the three styles share: each icon and shield in the colors of the light and of the dark branch. |
|
|
76
|
+
|
|
77
|
+
Each differs from the map-jr-gl style in three things:
|
|
78
|
+
|
|
79
|
+
- **The icons are in a sprite.** Each icon with `params` becomes one image of the sprite for each set of colors that it
|
|
80
|
+
can have, named by the icon and a hash of its colors (`arrow-94b3af`). The `icon-image` of a layer chooses the name
|
|
81
|
+
with a `match` on the class, for each branch of `color-scheme`. The sprite has 293 images: 63 KB at 1x, 154 KB at 2x.
|
|
82
|
+
- **The labels use glyphs.** The fonts of the system become the Noto Sans fonts of OpenFreeMap
|
|
83
|
+
(`https://tiles.openfreemap.org/fonts/`): Regular, and Bold for Semibold and Bold, and Italic for both italics. So
|
|
84
|
+
the labels look less like the platform than in map-jr-gl.
|
|
85
|
+
- **No `map-jr:` metadata.** MapLibre has no server render and no SVG images, so `map-jr:ssr` and `map-jr:images` are
|
|
86
|
+
removed.
|
|
87
|
+
|
|
88
|
+
MapLibre GL JS reads the global state `relief` of Elevation · radar from 5.16.0. With `relief` false it loads no
|
|
89
|
+
elevation tiles, and its attribution leaves out Mapterhorn. The OpenFreeMap styles have no MapLibre version: OpenFreeMap
|
|
90
|
+
serves them for MapLibre already (`https://tiles.openfreemap.org/styles/liberty`).
|
|
91
|
+
|
|
92
|
+
### From npm
|
|
93
|
+
|
|
94
|
+
The package [`@map-jr/styles`](https://www.npmjs.com/package/@map-jr/styles) has the same styles, by the same names:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pnpm add @map-jr/styles
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import style from '@map-jr/styles/elevation.json' with {type: 'json'};
|
|
102
|
+
|
|
103
|
+
createMap('map', {style});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The MapLibre styles are at `@map-jr/styles/maplibre/<name>.json`. Their sprite stays at `https://styles.map-jr.org/1/`:
|
|
107
|
+
the package does not have it.
|
|
108
|
+
|
|
109
|
+
A bundler (Vite, webpack, esbuild) takes the import as it is; Node.js needs `with {type: 'json'}`. A range such as
|
|
110
|
+
`^1.0.0` takes each release that does not break a map, as `/1/` does. The CDNs of npm serve the package too:
|
|
111
|
+
`https://cdn.jsdelivr.net/npm/@map-jr/styles@1/elevation.json`. The package has only the styles without white
|
|
112
|
+
space (`dist/styles/*.min.json` and `dist/maplibre/*.min.json`), the changelog, and the licences of the material in
|
|
113
|
+
`NOTICE.md`.
|
|
114
|
+
|
|
115
|
+
## Release
|
|
116
|
+
|
|
117
|
+
A release is a pull request that changes `"version"` in `package.json` and adds the section of that version to
|
|
118
|
+
[CHANGELOG.md](CHANGELOG.md). Merging it releases the version: the workflow `Release` uploads the styles to
|
|
119
|
+
`/<major>/`, publishes `@map-jr/styles` to npm, pushes the tag `v<version>`, and makes the release on GitHub with the
|
|
120
|
+
section as its text and `dist/` as a zip. Nobody pushes a tag or makes a release by hand. A release replaces the styles of its major version: `1.3.0` writes
|
|
121
|
+
`/1/`, and `2.0.0` writes `/2/` and leaves `/1/` as it was.
|
|
122
|
+
|
|
123
|
+
1. **Check `main`.** The workflow `build` is green for the commit to release.
|
|
124
|
+
2. **Choose the version.** The third number is always 0.
|
|
125
|
+
- A change that does not break a map (a color, a new layer, a fix) increases the second number: `1.2.0` → `1.3.0`.
|
|
126
|
+
- A change that breaks a map (a layer id renamed or removed, a global state property changed, a newer map-jr-gl
|
|
127
|
+
needed) increases the first number: `1.3.0` → `2.0.0`. Its section in the changelog starts with "Breaking
|
|
128
|
+
changes", which says what stopped working and what to do instead.
|
|
129
|
+
3. **Open the pull request of the release.** On a branch from `main`, set `"version"` in `package.json`, and add
|
|
130
|
+
`## 1.3.0 (2026-11-20)` at the top of `CHANGELOG.md`, with what changed since the last release. Then:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm run build && pnpm run check && pnpm test && pnpm run test:package
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
4. **Merge it** when CI passes, and follow the workflow `Release` in the Actions tab.
|
|
137
|
+
5. **Check the release:**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
curl https://styles.map-jr.org/1/version.json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm view @map-jr/styles@1.3.0 version
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The first gives `{"version":"1.3","commit":"…"}`, with the commit of the merge, and the second `1.3.0`. The edge has the new styles within 5
|
|
148
|
+
minutes; a browser that has the last release gets the new one within a day.
|
|
149
|
+
|
|
150
|
+
A section whose heading says `(unreleased)` is not released: the workflow does nothing for it. The workflow stops,
|
|
151
|
+
and uploads nothing, when the changelog has no section for the version, when `/<major>/` has the same release from
|
|
152
|
+
another commit or a newer release, or when npm has the version and the tag `v<version>` does not exist. A run that stopped after the upload can be run again from the Actions tab
|
|
153
|
+
(**Run workflow** on `main`): it does only what is left. To undo a release, release the earlier state as a newer
|
|
154
|
+
version. `node scripts/publish.mjs --dry-run` lists the files that a release uploads, without uploading them.
|
|
155
|
+
|
|
156
|
+
It needs, in the repository:
|
|
157
|
+
|
|
158
|
+
| Name | Kind | What it is |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| `CLOUDFLARE_ACCOUNT_ID` | Variable | The Cloudflare account of the bucket |
|
|
161
|
+
| `R2_BUCKET` | Variable | The name of the bucket |
|
|
162
|
+
| `R2_API_TOKEN` | Secret | The token value of an R2 API token with Object Read & Write on the bucket only |
|
|
163
|
+
|
|
164
|
+
The repository has no token of npm. npm trusts the workflow `Release` by its file name (`release.yml`), as a trusted
|
|
165
|
+
publisher in the settings of the package on npmjs.com, and adds a provenance statement to each version. Renaming the
|
|
166
|
+
file needs the same change there.
|
|
167
|
+
|
|
168
|
+
The script makes the S3 keys of R2 from the token, as Cloudflare documents them: the key ID is the id of the token,
|
|
169
|
+
and the secret is the SHA-256 of its value.
|
|
170
|
+
|
|
171
|
+
Cloudflare does not cache `.json` by default. A Cache Rule on the zone makes it: for the hostname
|
|
172
|
+
`styles.map-jr.org`, **Eligible for cache**, with the edge TTL from the `Cache-Control` header of the origin. With
|
|
173
|
+
the short edge TTL and `stale-while-revalidate`, a release reaches the edge in minutes with no purge, and a reader
|
|
174
|
+
does not wait while a file is fetched again.
|
|
175
|
+
|
|
176
|
+
## Build
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
pnpm install
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pnpm run build
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`dist/` is committed, so that a style has a URL. `pnpm run check` fails when `dist/` is not what the sources give;
|
|
187
|
+
CI runs it, and `pnpm test`. The build writes the map-jr-gl styles to `dist/styles/`, and the MapLibre styles and
|
|
188
|
+
their sprite to `dist/maplibre/`.
|
|
189
|
+
|
|
190
|
+
## Editing a style with Maputnik
|
|
191
|
+
|
|
192
|
+
An edit in Maputnik reaches the repository as a change to the sources, because the build writes `dist/` from them
|
|
193
|
+
and overwrites an edit made there.
|
|
194
|
+
|
|
195
|
+
1. Open the built style in the Maputnik of map-jr-gl:
|
|
196
|
+
`https://map-jr.github.io/maputnik/?style=https://styles.map-jr.org/@main/elevation.json`.
|
|
197
|
+
2. Edit it, and save it with **Save** (a file such as `elevation.json`).
|
|
198
|
+
3. Apply it to the sources, and build:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
ppnpm run apply-edit ~/Downloads/elevation.json
|
|
202
|
+
pnpm run build
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The command builds the style from the sources in memory and compares it with the saved style, layer by layer and
|
|
206
|
+
property by property. It finds the style by the file name, or by the layers when the name is not the name of a
|
|
207
|
+
style. A second argument gives the name: `ppnpm run apply-edit saved.json elevation-radar`. For each difference it
|
|
208
|
+
tries the places that the value can come from, builds again, and keeps a change only when it removes differences and
|
|
209
|
+
adds none.
|
|
210
|
+
|
|
211
|
+
| Edit | Where it goes |
|
|
212
|
+
|---|---|
|
|
213
|
+
| A value of a layer that the source style has: a light color, a number, a filter, a layout property | `styles/src/<name>.json` |
|
|
214
|
+
| A new layer, a removed layer, the order of the layers | `styles/src/<name>.json` |
|
|
215
|
+
| The dark value of a `case` on `color-scheme` | `PAIRS` in `styles/<name>.mjs`, by the `dark\|light` pair of the source. When other layers share the pair and keep their value, the dark value goes into the source. |
|
|
216
|
+
| The light value of such a `case` | The source, and the pair in `PAIRS` moves to the new light value |
|
|
217
|
+
|
|
218
|
+
The command does not map a value that a module makes: the images and their colors (`useIcons`, `ICON_DARK`), the
|
|
219
|
+
road shields, the peak and name labels, the layers that a module adds (`place_capital`), and a value that a module
|
|
220
|
+
sets (the hillshade colors, the light airport colors). It does not map an edit that changes the length of a filter to
|
|
221
|
+
which a module adds a clause. It lists each of these with its layer and property and writes nothing for it, so that
|
|
222
|
+
you can change the module by hand. At the end it builds from the files again, lists each property that still differs
|
|
223
|
+
from the saved style, and exits with 1 when there is one. It does not edit the OpenFreeMap styles, which are copies
|
|
224
|
+
of their sources.
|
|
225
|
+
|
|
226
|
+
## How it is made
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
icons/upstream/*.svg the SVG sources of the OpenFreeMap sprite (ofm_f384), one file for each icon
|
|
230
|
+
icons/extra.json POI classes the sprite has no icon for: new icons from Maki glyphs, and aliases
|
|
231
|
+
icons/extra/*.svg the new icons (pnpm run update-icons)
|
|
232
|
+
icons/custom/*.svg icons drawn for this repository
|
|
233
|
+
shields/*.svg road shield templates, written by hand
|
|
234
|
+
shields/shields.mjs how each shield stretches, and the networks whose look is set by hand
|
|
235
|
+
shields/networks.json the look of each road network, from OSM Americana (pnpm run update-shields)
|
|
236
|
+
styles/src/*.json the source styles, which use the sprite
|
|
237
|
+
styles/*.mjs one module for each style (or family): its dark palette and its fixes
|
|
238
|
+
styles/shared.mjs the dark icon colors and the neutral shield plate
|
|
239
|
+
lib/ the build steps
|
|
240
|
+
lib/maplibre.mjs the MapLibre styles and their sprite
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Icons.** `lib/icons.mjs` minifies each upstream SVG with SVGO and replaces each color by a slot named for its
|
|
244
|
+
role: `{{color}}` (the glyph), `{{background}}` (the plate behind it) and `{{border}}` (the outline or halo). The
|
|
245
|
+
build writes three files to `dist/icons/`: `icons.min.json` (`{"name": "<svg…>"}`), `icons.template.json` (the same
|
|
246
|
+
with slots) and `icons.defaults.json` (the colors of each icon). An icon whose colors fit no rule stops the build.
|
|
247
|
+
|
|
248
|
+
The tiles have POI classes that the sprite has no icon for. `icons/extra.json` gives 14 of them a new icon, drawn
|
|
249
|
+
from a [Maki](https://github.com/mapbox/maki) glyph in the look of the sprite, and gives 34 more the icon of a
|
|
250
|
+
class that has one (`atm` is `bank`, `yoga` is `sports_centre`). In the styles of this repository an alias costs no
|
|
251
|
+
image: the layer draws it from the image of its target.
|
|
252
|
+
|
|
253
|
+
**Styles.** A style module gets the source style and changes it: `useIcons` puts the templates that the layers use
|
|
254
|
+
into `metadata["map-jr:images"]`, turns each `icon-image` into an `image` expression with the colors as `params`,
|
|
255
|
+
and removes `sprite`. `retune` gives the dark branch of the source style new values, by its `dark|light` pair.
|
|
256
|
+
|
|
257
|
+
**Road shields.** `useShields` gives the shield layer one template for each shape, which stretches around the route
|
|
258
|
+
number with `icon-text-fit`. The shape and the colors come from `route_1_network` of the OpenMapTiles layer
|
|
259
|
+
`transportation_name`. To add a network, add its name to an entry of `NETWORKS` in `shields/shields.mjs`, or add an
|
|
260
|
+
entry. To add a shape, add an SVG with slots to `shields/` and its stretch columns to `SHAPES`.
|
|
261
|
+
|
|
262
|
+
| Shape | Networks |
|
|
263
|
+
|---|---|
|
|
264
|
+
| `us_interstate` | US Interstates |
|
|
265
|
+
| `us_highway` | US Highways |
|
|
266
|
+
| `pill` | US state routes, and the networks Americana draws as a pill or an ellipse |
|
|
267
|
+
| `hex` | German Autobahn, Italian autostrade, and the networks Americana draws as a horizontal hexagon |
|
|
268
|
+
| `rect` | The other networks, with the colors of their signs; a neutral plate for a network that is not listed |
|
|
269
|
+
|
|
270
|
+
The colors and shapes come from the shield definitions of OSM Americana: `pnpm run update-shields` downloads them
|
|
271
|
+
and writes `shields/networks.json`. It keeps the networks of a country, state or province (about 200) and leaves out
|
|
272
|
+
county and city networks. A shield that Americana draws from artwork (most US states, Mexico, Korea) gets the pill or
|
|
273
|
+
the neutral plate here, unless `MANUAL` in `shields/shields.mjs` gives it a look.
|
|
274
|
+
|
|
275
|
+
**Global state.** The elevation styles of this repository read these properties of the global state of the map:
|
|
276
|
+
|
|
277
|
+
| Property | Values | Effect |
|
|
278
|
+
|---|---|---|
|
|
279
|
+
| `color-scheme` | `light` (default), `dark` | The branch of the style. map-jr-gl sets it from `colorScheme`. |
|
|
280
|
+
| `elevation-unit` | `ft` (default), `m` | The unit of the elevation in peak labels. Set it with `globalState: {'elevation-unit': 'm'}`. |
|
|
281
|
+
| `relief` | `true` (default), `false` | Elevation · radar: the hillshade and the labels of peaks. With `false` they are hidden, and no elevation tiles load. |
|
|
282
|
+
| `language` | none (default), or a language code of the tiles such as `de`, `fr`, `ja` | The language of the names, for each feature that has a name in it. Without it, a place with a name in a script other than Latin shows its Latin name and that name, and other names are English. |
|
|
283
|
+
|
|
284
|
+
`relief` switches layers with a `global-state` expression in `visibility`, which MapLibre GL JS reads from
|
|
285
|
+
5.16.0, and map-jr-gl after 0.8.0 ([map-jr/map-jr-gl#998](https://github.com/map-jr/map-jr-gl/issues/998)). An
|
|
286
|
+
older map-jr-gl shows the layers and loads their tiles whatever the state is.
|
|
287
|
+
|
|
288
|
+
**OpenFreeMap styles.** `styles/openfreemap.mjs` builds the five styles of OpenFreeMap with `inlineSprite`: the
|
|
289
|
+
images that a layer can ask for go into the style as plain SVG, and the layers are not changed, except for
|
|
290
|
+
`map-jr:ssr` in their metadata (below).
|
|
291
|
+
|
|
292
|
+
**Server render.** `ssr` in `lib/style.mjs` gives the layers of each style `metadata["map-jr:ssr"]`: changes for
|
|
293
|
+
the first view that the server renderer of map-jr-gl writes (`renderToSVG`, `renderFirstView`, the `ssr` prop of
|
|
294
|
+
the Vue component), which a page shows inline until the map draws. MapLibre GL JS and the map in the browser ignore
|
|
295
|
+
them. The first view is a placeholder, like a blurred image while the full one loads: it must be small, and it only
|
|
296
|
+
gives the colors and the large shapes of the place. The map draws everything else over it.
|
|
297
|
+
|
|
298
|
+
| Layers | `map-jr:ssr` | Why |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| The background, rasters, hillshade | none | |
|
|
301
|
+
| Land cover, land use, parks | `{"simplify": 8, "minSize": 48}` | Only the large shapes. |
|
|
302
|
+
| Water | `{"simplify": 6, "minSize": 24}` | |
|
|
303
|
+
| Borders | `{"simplify": 8, "minSize": 32}` | |
|
|
304
|
+
| Roads: motorways, trunk and primary roads | `{"simplify": 8, "minSize": 1, "filter": …}` | A road is many short pieces: a larger `minSize` breaks it into dashes. |
|
|
305
|
+
| Roads: secondary and tertiary | the same, from zoom 14 | At lower zooms they are most of the bytes. |
|
|
306
|
+
| Roads: minor and service | the same, from zoom 15 | |
|
|
307
|
+
| Names of countries, states, cities and towns | `{"filter": …}` | |
|
|
308
|
+
| Everything else: buildings, casings, tunnels, railways, paths, rivers drawn as lines, other labels and icons, image patterns | `{"hidden": true}` | |
|
|
309
|
+
| A layer below the zoom where its width or opacity can be seen (0.1 pixel, 5%) | `{"minzoom": …}` | map-jr-gl 0.8.0 writes the features of such a layer, which draw nothing. |
|
|
310
|
+
|
|
311
|
+
The filter of a road layer draws each class from its zoom, and the layer gets `minzoom` of the most important class
|
|
312
|
+
that its own filter names. (map-jr-gl 0.8.0 reads `["zoom"]` in a filter as the zoom of the tile, which is never above
|
|
313
|
+
14 on OpenMapTiles: with it, minor roads do not show.)
|
|
314
|
+
|
|
315
|
+
Render the placeholder with `tileZoomOffset: 2` (map-jr-gl after 0.8.0): the server builds it from tiles two zooms
|
|
316
|
+
lower, which have fewer and longer features, and fetches fewer tiles.
|
|
317
|
+
|
|
318
|
+
| Over six views and six styles, gzip | `overrides: false` | Placeholder | Placeholder, `tileZoomOffset: 2` |
|
|
319
|
+
|---|---|---|---|
|
|
320
|
+
| All 36 renders | 2194 KB, 144 tiles | 521 KB (−76%), 144 tiles | **304 KB (−86%), 60 tiles** |
|
|
321
|
+
| Most views | 21 to 125 KB | 5 to 21 KB | 4 to 12 KB |
|
|
322
|
+
| Paris at zoom 10 | 67 to 150 KB | 31 to 42 KB | 13 to 18 KB |
|
|
323
|
+
|
|
324
|
+
The views are Manhattan at zoom 12 and 15, Oakland at 13.5, Paris at 10, the Alps at 11 and Atlanta's suburbs at 15,
|
|
325
|
+
800 × 500, measured with map-jr-gl at c4d5e87. A layer whose source style has `map-jr:ssr` keeps it. To render
|
|
326
|
+
without the changes, pass `overrides: false`; to change one layer, pass `overrides: {"<layer id>": {…}}`.
|
|
327
|
+
|
|
328
|
+
**MapLibre styles.** `maplibre` in `lib/maplibre.mjs` builds them from the built map-jr-gl style of each style that
|
|
329
|
+
has a global state `color-scheme`. For each `image` expression it finds the values that the image and its colors can
|
|
330
|
+
depend on: the labels of each `match` in it, and the names of the images, less those that the filter of the layer
|
|
331
|
+
leaves out. It works out the name and the colors for each value, in light and in dark, with the expressions of
|
|
332
|
+
MapLibre (`@maplibre/maplibre-gl-style-spec`), and writes one `match` for each branch. The build stops when an image
|
|
333
|
+
reads more than two properties, another global state, or the zoom. `sheet` packs the images in rows, 256 pixels
|
|
334
|
+
wide, and draws them at 1x and 2x with resvg. A shield keeps its `stretchX`, `stretchY` and `content`. The style is
|
|
335
|
+
then checked with `validateStyleMin` of MapLibre.
|
|
336
|
+
|
|
337
|
+
## Preview
|
|
338
|
+
|
|
339
|
+
`pnpm run preview` draws each style in light and dark, side by side, at the views of `test/views.json` (a range of
|
|
340
|
+
zoom levels and kinds of place), into `test/shots/`. Set `STATE` to try a global state: `STATE='{"elevation-unit":"m"}' node test/preview.mjs elevation chamonix`. It needs Playwright with Chromium, and the `dist/` folder of a
|
|
341
|
+
map-jr-gl build in `test/lib/`. Pass a style and a view to draw one: `node test/preview.mjs elevation-radar rockies`.
|
|
342
|
+
|
|
343
|
+
`test/maplibre.html` shows a MapLibre style in MapLibre GL JS, with the sprite of the checkout. Serve the repository
|
|
344
|
+
root (`python3 -m http.server 8123`) and open
|
|
345
|
+
`http://localhost:8123/test/maplibre.html?style=elevation&scheme=dark&view=11/39.74/-105`. `state.relief=false` sets
|
|
346
|
+
a global state, `pitch=60` tilts the map, and `v=6.19.0` picks another version of MapLibre GL JS. The bar at the top
|
|
347
|
+
lists the images that the sprite does not have.
|
|
348
|
+
|
|
349
|
+
## Sources and licences
|
|
350
|
+
|
|
351
|
+
The code and the shield templates of this repository have the MIT licence (`LICENSE`). The icons, the source styles
|
|
352
|
+
and the network table come from OpenFreeMap, OSM Liberty, OpenMapTiles, Maki and OSM Americana and keep their own terms: see
|
|
353
|
+
`NOTICE.md`. The idea of a shape and colors for each route network follows
|
|
354
|
+
[Trailblazer](https://github.com/osm-americana/trailblazer).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":8,"metadata":{"studio:source":"https://whatismyelevation.com/styles/radar.json","studio:palette":"Slate land, ink water, sage vegetation, warm arterial roads. Light branch preserves the source style."},"state":{"color-scheme":{"default":"light"},"elevation-unit":{"default":"ft"},"language":{"default":""},"relief":{"default":true}},"sources":{"openmaptiles":{"url":"https://tiles.openfreemap.org/planet","type":"vector"},"terrarium":{"type":"raster-dem","tiles":["https://tiles.mapterhorn.com/{z}/{x}/{y}.webp"],"maxzoom":12,"tileSize":512,"encoding":"terrarium","attribution":"<a href=\"https://mapterhorn.com/attribution\">© Mapterhorn</a>"}},"sprite":"https://styles.map-jr.org/1/maplibre/sprite","glyphs":"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":["case",["==",["global-state","color-scheme"],"dark"],"#1b1f24","rgba(255, 255, 255, 1)"]}},{"id":"landuse_residential","type":"fill","source":"openmaptiles","source-layer":"landuse","filter":["all",["in","class","residential","suburb","neighbourhood"]],"layout":{"visibility":"visible"},"paint":{"fill-color":["interpolate",["linear"],["zoom"],6,["case",["==",["global-state","color-scheme"],"dark"],"#1b1f24","rgb(255, 255, 255)"],14,["case",["==",["global-state","color-scheme"],"dark"],"#414850","rgb(240, 240, 240)"],18,["case",["==",["global-state","color-scheme"],"dark"],"#414850","rgb(240, 240, 240)"]],"fill-opacity":{"stops":[[0,0],[6,0.15],[10,0.2]]}}},{"id":"landcover_grass","type":"fill","source":"openmaptiles","source-layer":"landcover","filter":["==","class","grass"],"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#474f57","rgb(244, 244, 244)"],"fill-opacity":0.15}},{"id":"landcover_wood","type":"fill","source":"openmaptiles","source-layer":"landcover","filter":["==","class","wood"],"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#535b63","rgb(237, 237, 237)"],"fill-opacity":0.2}},{"id":"landcover_sand","type":"fill","source":"openmaptiles","source-layer":"landcover","filter":["all",["in","class","sand"]],"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#727980","rgb(188, 188, 188)"],"fill-opacity":0.2,"fill-antialias":false}},{"id":"landcover_glacier","type":"fill","source":"openmaptiles","source-layer":"landcover","filter":["all",["in","subclass","glacier","ice_shelf"]],"layout":{"visibility":"visible"},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#2c3238","rgb(243, 243, 243)"],"fill-opacity":0.8}},{"id":"terrain-rgb-terrarium","type":"hillshade","source":"terrarium","minzoom":0,"paint":{"hillshade-shadow-color":["case",["==",["global-state","color-scheme"],"dark"],"#050608","hsl(39, 21%, 33%)"],"hillshade-illumination-direction":315,"hillshade-exaggeration":["interpolate",["linear"],["zoom"],10,["case",["==",["global-state","color-scheme"],"dark"],0.45,0.2],16,["case",["==",["global-state","color-scheme"],"dark"],0.3,0.1]],"hillshade-highlight-color":["case",["==",["global-state","color-scheme"],"dark"],"#7b858e","#FFFFFF"],"hillshade-accent-color":"#000000"},"layout":{"visibility":["case",["global-state","relief"],"visible","none"]}},{"id":"water","type":"fill","source":"openmaptiles","source-layer":"water","filter":["all",["!=","intermittent",1],["!=","brunnel","tunnel"]],"layout":{"visibility":"visible"},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","rgb(217, 218, 221)"]}},{"id":"water_intermittent","type":"fill","source":"openmaptiles","source-layer":"water","filter":["all",["==","intermittent",1]],"layout":{"visibility":"visible"},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","rgb(217, 218, 221)"],"fill-opacity":0.7}},{"id":"waterway_tunnel","type":"line","source":"openmaptiles","source-layer":"waterway","filter":["all",["==","brunnel","tunnel"]],"layout":{"visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","rgb(217, 218, 221)"],"line-width":1,"line-opacity":0.7,"line-dasharray":[3,3]}},{"id":"waterway","type":"line","source":"openmaptiles","source-layer":"waterway","filter":["all",["!in","brunnel","tunnel","bridge"],["!=","intermittent",1]],"layout":{"visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","rgb(217, 218, 221)"],"line-width":{"stops":[[8,1],[15,3]]},"line-opacity":1}},{"id":"waterway_intermittent","type":"line","source":"openmaptiles","source-layer":"waterway","filter":["all",["!in","brunnel","tunnel","bridge"],["==","intermittent",1]],"layout":{"visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","rgb(217, 218, 221)"],"line-width":{"stops":[[8,1],[15,3]]},"line-opacity":1,"line-dasharray":[2,1]}},{"id":"building","type":"fill","source":"openmaptiles","source-layer":"building","layout":{"visibility":"none"},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#42454a","rgba(212, 204, 176, 1)"],"fill-opacity":0.4,"fill-antialias":true}},{"id":"road_area_pier","type":"fill","source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","Polygon"],["==","class","pier"]],"layout":{"visibility":"visible"},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#30363c","rgb(250, 250, 250)"],"fill-opacity":1,"fill-antialias":true}},{"id":"road_area_bridge","type":"fill","source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","Polygon"],["in","brunnel","bridge"]],"layout":{},"paint":{"fill-color":["case",["==",["global-state","color-scheme"],"dark"],"#3b4147","hsl(47, 26%, 88%)"],"fill-opacity":0.7}},{"id":"road_pier","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["in","class","pier"]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#3b4147","hsl(47, 26%, 88%)"],"line-width":1}},{"id":"road_path","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":14,"filter":["all",["in","class","path","track"]],"layout":{"line-cap":"square","line-join":"bevel"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#30363c","hsl(0, 0%, 97%)"],"line-width":{"base":1.55,"stops":[[14,0.5],[20,4]]},"line-dasharray":[1,1]}},{"id":"road_minor","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["all",["in","class","minor","service"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#373d44","hsl(0, 0%, 92%)"],"line-width":{"base":1.55,"stops":[[4,0.25],[20,24]]}}},{"id":"road_tunnel","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","primary","secondary","tertiary","trunk","minor_road"]],"layout":{"line-cap":"butt","line-join":"miter","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#454c54","#fff"],"line-width":{"base":1.4,"stops":[[7,0.5],[20,24]]},"line-opacity":0.75,"line-dasharray":[0.28,0.14]}},{"id":"road_major","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":7,"filter":["all",["in","class","trunk","primary","secondary","tertiary"],["!=","brunnel","tunnel"],["!=","brunnel","bridge"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#454c54","#eee"],"line-width":{"base":1.4,"stops":[[7,0.5],[20,28]]}}},{"id":"road_motorway","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":4,"filter":["all",["==","class","motorway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#50575f","hsl(0, 0%, 92%)"],"line-width":{"base":1.4,"stops":[[8,1],[16,10]]},"line-offset":0}},{"id":"railway_transit_tunnel","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":0,"filter":["all",["==","brunnel","tunnel"],["==","class","transit"]],"layout":{"line-cap":"butt","line-join":"miter","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#63676e","hsl(34, 12%, 66%)"],"line-opacity":0.5,"line-dasharray":[3,3]}},{"id":"railway","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":11,"filter":["==","class","rail"],"layout":{"visibility":"none"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#63676e","hsl(34, 12%, 66%)"],"line-opacity":0.5}},{"id":"railway_transit","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["==","class","transit"],["!=","brunnel","tunnel"]],"layout":{"visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#63676e","hsl(34, 12%, 66%)"],"line-opacity":0.5}},{"id":"aeroway_taxiway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":12,"filter":["all",["in","class","taxiway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#434a52","rgba(255, 255, 255, 1)"],"line-width":1,"line-opacity":1}},{"id":"aeroway_runway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":4,"filter":["all",["in","class","runway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#434a52","rgba(255, 255, 255, 1)"],"line-width":5,"line-opacity":1}},{"id":"bridge_waterway","type":"line","source":"openmaptiles","source-layer":"waterway","filter":["all",["==","brunnel","bridge"]],"layout":{"line-cap":"round","line-join":"round","visibility":"none"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#30373f","hsl(205, 56%, 73%)"],"line-width":1}},{"id":"bridge","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary","secondary","tertiary","trunk"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#454c54","#eee"],"line-width":{"base":1.4,"stops":[[7,0.5],[20,28]]}}},{"id":"admin_sub","type":"line","source":"openmaptiles","source-layer":"boundary","minzoom":3,"filter":["all",["in","admin_level",4,6,8],["!=","maritime",1]],"layout":{"visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(107, 116, 125, 0.7)","rgba(184, 192, 201, 0.5)"],"line-width":1.25,"line-dasharray":[2,1]}},{"id":"admin_disputed","type":"line","source":"openmaptiles","source-layer":"boundary","minzoom":5,"filter":["all",["all",["<=","admin_level",2],["==","$type","LineString"],["==","disputed",1]],["!=","maritime",1]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#6b747d","rgb(194, 201, 209)"],"line-width":1,"line-dasharray":[2,2]}},{"id":"admin_country","type":"line","source":"openmaptiles","source-layer":"boundary","minzoom":0,"filter":["all",["all",["<=","admin_level",2],["==","$type","LineString"],["!has","claimed_by"]],["!=","maritime",1],["!=","disputed",1]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":["case",["==",["global-state","color-scheme"],"dark"],"#6b747d","rgb(194, 201, 209)"],"line-width":1}},{"id":"label_airport","type":"symbol","source":"openmaptiles","source-layer":"aerodrome_label","minzoom":10,"filter":["all",["has","iata"]],"layout":{"icon-size":1,"text-font":["Noto Sans Regular"],"text-size":11,"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["case",["all",["has","name:nonlatin"],["has","name:latin"]],["concat",["get","name:latin"],"\n",["get","name:nonlatin"]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]]],"visibility":"visible","text-anchor":"top","text-offset":[0,0.5],"text-max-width":8},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#858f98","rgb(141, 148, 156)"],"text-halo-blur":1,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(27, 31, 36, 0.8)","rgba(255, 255, 255, 0.75)"],"text-halo-width":1}},{"id":"label_road","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":13,"filter":["all",["==","$type","LineString"],["!=","subclass","ferry"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.4,"stops":[[10,8],[20,14]]},"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["case",["all",["has","name:nonlatin"],["has","name:latin"]],["concat",["get","name:latin"]," ",["get","name:nonlatin"]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]]],"visibility":"visible","text-transform":"uppercase","symbol-placement":"line","text-letter-spacing":0.1,"text-rotation-alignment":"map"},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#a4adb5","rgb(107, 115, 124)"],"text-halo-color":"rgba(0, 0, 0, 0)","text-halo-width":2}},{"id":"poi_peak_3","type":"symbol","source":"openmaptiles","source-layer":"mountain_peak","minzoom":10,"maxzoom":24,"filter":["all",["==","$type","Point"],[">=","class",3]],"layout":{"text-anchor":"top","text-field":["case",["==",["global-state","elevation-unit"],"m"],["case",[">",["to-number",["get","ele"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele"],{}]," m)"],["get","name_int"]],["case",[">",["to-number",["get","ele_ft"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele_ft"],{}]," ft)"],["get","name_int"]]],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":6,"icon-image":["case",["==",["global-state","color-scheme"],"dark"],"mountain_11-72517d","mountain_11-4fff07"],"icon-optional":false,"icon-text-fit":"none","symbol-placement":"point","text-offset":[0,1],"visibility":["case",["global-state","relief"],"visible","none"]},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#a4adb5","#666"],"text-halo-blur":0.5,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"#1b1f24","#ffffff"],"text-halo-width":1}},{"id":"poi_peak_2","type":"symbol","source":"openmaptiles","source-layer":"mountain_peak","minzoom":4,"maxzoom":24,"filter":["all",["==","$type","Point"],["==","class",2]],"layout":{"text-anchor":"top","text-field":["case",["==",["global-state","elevation-unit"],"m"],["case",[">",["to-number",["get","ele"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele"],{}]," m)"],["get","name_int"]],["case",[">",["to-number",["get","ele_ft"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele_ft"],{}]," ft)"],["get","name_int"]]],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":6,"icon-image":["case",["==",["global-state","color-scheme"],"dark"],"mountain_11-72517d","mountain_11-4fff07"],"icon-optional":false,"icon-text-fit":"none","symbol-placement":"point","text-offset":[0,1],"visibility":["case",["global-state","relief"],"visible","none"]},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#a4adb5","#666"],"text-halo-blur":0.5,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"#1b1f24","#ffffff"],"text-halo-width":1}},{"id":"poi_peak_1","type":"symbol","source":"openmaptiles","source-layer":"mountain_peak","minzoom":0,"maxzoom":24,"filter":["all",["==",["geometry-type"],"Point"],["==",["get","rank"],1]],"layout":{"text-anchor":"top","text-field":["case",["==",["global-state","elevation-unit"],"m"],["case",[">",["to-number",["get","ele"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele"],{}]," m)"],["get","name_int"]],["case",[">",["to-number",["get","ele_ft"],0],0],["concat",["get","name_int"]," (",["number-format",["get","ele_ft"],{}]," ft)"],["get","name_int"]]],"text-font":["Noto Sans Bold"],"text-size":{"stops":[[6,11],[10,13]]},"text-max-width":6,"icon-optional":false,"icon-text-fit":"none","symbol-placement":"point","text-offset":[0,0.6],"icon-image":["case",["==",["global-state","color-scheme"],"dark"],"triangle_11-5b4420","triangle_11-1e93d1"],"visibility":["case",["global-state","relief"],"visible","none"]},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#eaa76b","rgba(165, 71, 8, 1)"],"text-halo-blur":0.5,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"#1b1f24","#ffffff"],"text-halo-width":1}},{"id":"label_place_other","type":"symbol","source":"openmaptiles","source-layer":"place","minzoom":8,"filter":["all",["==","$type","Point"],["!in","class","city","state","country","continent"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"stops":[[6,10],[12,14]]},"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["case",["all",["has","name:nonlatin"],["has","name:latin"]],["concat",["get","name:latin"],"\n",["get","name:nonlatin"]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]]],"visibility":"visible","text-anchor":"center","text-max-width":6},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#a4adb5","rgb(107, 115, 124)"],"text-halo-blur":0,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(27, 31, 36, 0.8)","rgba(255, 255, 255, 0.75)"],"text-halo-width":2}},{"id":"label_place_city","type":"symbol","source":"openmaptiles","source-layer":"place","maxzoom":14,"filter":["all",["==","$type","Point"],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"stops":[[3,11],[8,16]]},"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["case",["all",["has","name:nonlatin"],["has","name:latin"]],["concat",["get","name:latin"],"\n",["get","name:nonlatin"]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]]],"text-max-width":10},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#a4adb5","rgb(107, 115, 124)"],"text-halo-blur":0,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(27, 31, 36, 0.8)","rgba(255, 255, 255, 0.75)"],"text-halo-width":2}},{"id":"label_country_other","type":"symbol","source":"openmaptiles","source-layer":"place","maxzoom":12,"filter":["all",["==","$type","Point"],["==","class","country"],["!has","iso_a2"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"stops":[[3,12],[8,22]]},"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]],"visibility":"visible","text-max-width":10},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#858f98","rgb(141, 148, 156)"],"text-halo-blur":0,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(27, 31, 36, 0.8)","rgba(255, 255, 255, 0.75)"],"text-halo-width":2}},{"id":"label_country","type":"symbol","source":"openmaptiles","source-layer":"place","maxzoom":12,"filter":["all",["==","$type","Point"],["==","class","country"],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-size":{"stops":[[3,12],[8,22]]},"text-field":["coalesce",["get",["concat","name:",["global-state","language"]]],["coalesce",["get","name_en"],["get","name:latin"],["get","name"]]],"visibility":"visible","text-max-width":10},"paint":{"text-color":["case",["==",["global-state","color-scheme"],"dark"],"#858f98","rgb(141, 148, 156)"],"text-halo-blur":0,"text-halo-color":["case",["==",["global-state","color-scheme"],"dark"],"rgba(27, 31, 36, 0.8)","rgba(255, 255, 255, 0.75)"],"text-halo-width":2}}]}
|