@map-jr/styles 1.1.0 → 1.2.1
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
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
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".
|
|
5
|
-
increases the second number
|
|
4
|
+
map increases the first number, and its entry starts with a section "Breaking changes". A version that adds to a
|
|
5
|
+
map increases the second number, and a fix increases the third. See [Release](README.md#release).
|
|
6
|
+
|
|
7
|
+
## 1.2.1 (2026-11-25)
|
|
8
|
+
|
|
9
|
+
- `https://styles.map-jr.org/data/natural-earth-5.1.2.pmtiles`: a PMTiles archive of the countries and the states and
|
|
10
|
+
provinces of Natural Earth 5.1.2 (public domain), for the PMTiles example of map-jr-gl. Its name has the version of
|
|
11
|
+
the data, and each upload from `main` or a release writes it.
|
|
12
|
+
- Elevation and Elevation · zero load the shaded relief of Natural Earth from OpenFreeMap as WebP
|
|
13
|
+
(`ne2sr/{z}/{x}/{y}.webp`) in place of PNG: the same 512-pixel tiles, with exactly the same pixels (the PNG tiles of
|
|
14
|
+
OpenFreeMap are its WebP tiles decoded), at about a sixteenth of the bytes. The source, layer and paint are the
|
|
15
|
+
same.
|
|
16
|
+
|
|
17
|
+
## 1.2.0 (2026-11-19)
|
|
18
|
+
|
|
19
|
+
- The styles are for map-jr-gl 0.9.0 or later: the peer dependency is now `>=0.9.0`. The filters of `map-jr:ssr` read
|
|
20
|
+
`["zoom"]` as the zoom of the render, and `relief` in Elevation · radar is a global state in `visibility`, both of
|
|
21
|
+
which map-jr-gl reads from 0.9.0. The styles still load in an older map-jr-gl, with the limits of 1.1.0. The
|
|
22
|
+
layers, images and URLs are the same.
|
|
6
23
|
|
|
7
24
|
## 1.1.0 (2026-11-19)
|
|
8
25
|
|
package/NOTICE.md
CHANGED
|
@@ -11,6 +11,7 @@ The material below comes from other projects and keeps its own terms. `dist/` is
|
|
|
11
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
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
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
|
+
| `data/natural-earth-5.1.2.pmtiles` | Countries and states and provinces at 1:50m of [Natural Earth](https://www.naturalearthdata.com/) 5.1.2, made into vector tiles (zoom 0 to 6) by `scripts/natural-earth-pmtiles.mjs` of [map-jr-gl](https://github.com/map-jr/map-jr-gl) | Public domain |
|
|
14
15
|
| `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
|
|
|
16
17
|
Map data shown with the styles: OpenFreeMap, © OpenMapTiles, data from OpenStreetMap; terrain © Mapterhorn.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# map-jr-styles
|
|
2
2
|
|
|
3
|
-
Map styles for [
|
|
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
4
|
templates, in place of a sprite sheet, and versions of the elevation styles for
|
|
5
5
|
[MapLibre GL JS](https://maplibre.org/maplibre-gl-js/). Each elevation style has a light and a dark branch, chosen by
|
|
6
6
|
the global state property `color-scheme`.
|
|
@@ -9,7 +9,7 @@ the global state property `color-scheme`.
|
|
|
9
9
|
|
|
10
10
|
Pass a link as the `style` of the map. Each one is the latest release of version 1.
|
|
11
11
|
|
|
12
|
-
| Style |
|
|
12
|
+
| Style | Map Jr. GL | MapLibre GL JS 5.16+ | What it is |
|
|
13
13
|
|---|---|---|---|
|
|
14
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
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. |
|
|
@@ -21,24 +21,24 @@ Pass a link as the `style` of the map. Each one is the latest release of version
|
|
|
21
21
|
| OpenFreeMap Positron | [openfreemap-positron.json](https://styles.map-jr.org/1/openfreemap-positron.json) | [OpenFreeMap's](https://tiles.openfreemap.org/styles/positron) | 〃 |
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
createMap('map', {style: 'https://styles.map-jr.org/1/elevation.json'}); //
|
|
24
|
+
createMap('map', {style: 'https://styles.map-jr.org/1/elevation.json'}); // Map Jr. GL
|
|
25
25
|
new maplibregl.Map({container: 'map', style: 'https://styles.map-jr.org/1/maplibre/elevation.json'}); // MapLibre GL JS
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
The same styles are in the npm package [`@map-jr/styles`](#from-npm): `@map-jr/styles/<name>.json` and
|
|
29
29
|
`@map-jr/styles/maplibre/<name>.json`. In this repository they are built to `dist/styles/` and `dist/maplibre/`.
|
|
30
30
|
|
|
31
|
-
Each style also has a `.min.json` without white space. The styles need a
|
|
31
|
+
Each style also has a `.min.json` without white space. The styles need a Map Jr. GL build that reads
|
|
32
32
|
`metadata["map-jr:images"]` and `params` of the `image` expression. MapLibre GL JS draws them without icons: use the
|
|
33
33
|
MapLibre styles for it ([below](#maplibre-gl-js)).
|
|
34
34
|
|
|
35
|
-
The three elevation styles have no `glyphs`:
|
|
35
|
+
The three elevation styles have no `glyphs`: Map Jr. GL draws their labels with the fonts of the browser, and makes no
|
|
36
36
|
requests for fonts. Each `text-font` is a stack of the fonts of the system, such as
|
|
37
37
|
`["system-ui Semibold", "Segoe UI Semibold", "Roboto Medium", "sans-serif"]`: SF Pro on Apple systems, Segoe UI on
|
|
38
38
|
Windows, Roboto on Android. The first name gives the weight and the style (Regular, Semibold, Bold, Italic, Semibold
|
|
39
|
-
Italic). This needs a
|
|
39
|
+
Italic). This needs a Map Jr. GL with commit `bd4d4ea` (a `text-font` stack as a CSS family list, with `system-ui`
|
|
40
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
|
|
41
|
+
font files in the `fonts` option of Map Jr. GL. MapLibre GL JS does not load a style
|
|
42
42
|
with text and no `glyphs`: its versions of these three styles have the glyphs of OpenFreeMap. The OpenFreeMap styles
|
|
43
43
|
keep the glyphs of OpenFreeMap.
|
|
44
44
|
|
|
@@ -56,7 +56,7 @@ createMap('map', {style: 'https://styles.map-jr.org/1/elevation.json'});
|
|
|
56
56
|
| `/1/version.json` | `{version, commit}` of the folder | As its folder |
|
|
57
57
|
|
|
58
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
|
|
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
60
|
one release as it is, host the zip of its GitHub release.
|
|
61
61
|
|
|
62
62
|
### MapLibre GL JS
|
|
@@ -74,14 +74,14 @@ map.setGlobalStateProperty('color-scheme', 'dark');
|
|
|
74
74
|
| `/1/maplibre/{elevation,elevation-zero,elevation-radar}.json` | The style, without white space. |
|
|
75
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
76
|
|
|
77
|
-
Each differs from the
|
|
77
|
+
Each differs from the Map Jr. GL style in three things:
|
|
78
78
|
|
|
79
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
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
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
82
|
- **The labels use glyphs.** The fonts of the system become the Noto Sans fonts of OpenFreeMap
|
|
83
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
|
|
84
|
+
the labels look less like the platform than in Map Jr. GL.
|
|
85
85
|
- **No `map-jr:` metadata.** MapLibre has no server render and no SVG images, so `map-jr:ssr` and `map-jr:images` are
|
|
86
86
|
removed.
|
|
87
87
|
|
|
@@ -121,9 +121,12 @@ section as its text and `dist/` as a zip. Nobody pushes a tag or makes a release
|
|
|
121
121
|
`/1/`, and `2.0.0` writes `/2/` and leaves `/1/` as it was.
|
|
122
122
|
|
|
123
123
|
1. **Check `main`.** The workflow `build` is green for the commit to release.
|
|
124
|
-
2. **Choose the version.**
|
|
125
|
-
- A
|
|
126
|
-
|
|
124
|
+
2. **Choose the version.**
|
|
125
|
+
- A fix that adds nothing (a color, a wrong filter, the docs of the package) increases the third number: `1.2.0` →
|
|
126
|
+
`1.2.1`.
|
|
127
|
+
- A change that adds to a map without breaking it (a new layer, style or global state property) increases the second
|
|
128
|
+
number: `1.2.1` → `1.3.0`.
|
|
129
|
+
- A change that breaks a map (a layer id renamed or removed, a global state property changed, a newer Map Jr. GL
|
|
127
130
|
needed) increases the first number: `1.3.0` → `2.0.0`. Its section in the changelog starts with "Breaking
|
|
128
131
|
changes", which says what stopped working and what to do instead.
|
|
129
132
|
3. **Open the pull request of the release.** On a branch from `main`, set `"version"` in `package.json`, and add
|
|
@@ -144,14 +147,16 @@ section as its text and `dist/` as a zip. Nobody pushes a tag or makes a release
|
|
|
144
147
|
npm view @map-jr/styles@1.3.0 version
|
|
145
148
|
```
|
|
146
149
|
|
|
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
|
|
150
|
+
The first gives `{"version":"1.3.0","commit":"…"}`, with the commit of the merge, and the second `1.3.0`. The edge has the new styles within 5
|
|
148
151
|
minutes; a browser that has the last release gets the new one within a day.
|
|
149
152
|
|
|
150
153
|
A section whose heading says `(unreleased)` is not released: the workflow does nothing for it. The workflow stops,
|
|
151
154
|
and uploads nothing, when the changelog has no section for the version, when `/<major>/` has the same release from
|
|
152
155
|
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
156
|
(**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.
|
|
157
|
+
version. `node scripts/publish.mjs --dry-run` lists the files that a release uploads, without uploading them. Each upload, from
|
|
158
|
+
`main` and from a release, also writes `data/` to `/data/`, outside the version folders, so a file there is live when its
|
|
159
|
+
pull request merges. A new build of a file gets a new name, such as `natural-earth-5.1.2.pmtiles` with the version of its data.
|
|
155
160
|
|
|
156
161
|
It needs, in the repository:
|
|
157
162
|
|
|
@@ -184,7 +189,7 @@ pnpm run build
|
|
|
184
189
|
```
|
|
185
190
|
|
|
186
191
|
`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
|
|
192
|
+
CI runs it, and `pnpm test`. The build writes the Map Jr. GL styles to `dist/styles/`, and the MapLibre styles and
|
|
188
193
|
their sprite to `dist/maplibre/`.
|
|
189
194
|
|
|
190
195
|
## Editing a style with Maputnik
|
|
@@ -192,19 +197,19 @@ their sprite to `dist/maplibre/`.
|
|
|
192
197
|
An edit in Maputnik reaches the repository as a change to the sources, because the build writes `dist/` from them
|
|
193
198
|
and overwrites an edit made there.
|
|
194
199
|
|
|
195
|
-
1. Open the built style in the Maputnik of
|
|
200
|
+
1. Open the built style in the Maputnik of Map Jr. GL:
|
|
196
201
|
`https://map-jr.github.io/maputnik/?style=https://styles.map-jr.org/@main/elevation.json`.
|
|
197
202
|
2. Edit it, and save it with **Save** (a file such as `elevation.json`).
|
|
198
203
|
3. Apply it to the sources, and build:
|
|
199
204
|
|
|
200
205
|
```bash
|
|
201
|
-
|
|
206
|
+
pnpm run apply-edit ~/Downloads/elevation.json
|
|
202
207
|
pnpm run build
|
|
203
208
|
```
|
|
204
209
|
|
|
205
210
|
The command builds the style from the sources in memory and compares it with the saved style, layer by layer and
|
|
206
211
|
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: `
|
|
212
|
+
style. A second argument gives the name: `pnpm run apply-edit saved.json elevation-radar`. For each difference it
|
|
208
213
|
tries the places that the value can come from, builds again, and keeps a change only when it removes differences and
|
|
209
214
|
adds none.
|
|
210
215
|
|
|
@@ -276,21 +281,21 @@ the neutral plate here, unless `MANUAL` in `shields/shields.mjs` gives it a look
|
|
|
276
281
|
|
|
277
282
|
| Property | Values | Effect |
|
|
278
283
|
|---|---|---|
|
|
279
|
-
| `color-scheme` | `light` (default), `dark` | The branch of the style.
|
|
284
|
+
| `color-scheme` | `light` (default), `dark` | The branch of the style. Map Jr. GL sets it from `colorScheme`. |
|
|
280
285
|
| `elevation-unit` | `ft` (default), `m` | The unit of the elevation in peak labels. Set it with `globalState: {'elevation-unit': 'm'}`. |
|
|
281
286
|
| `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
|
|
287
|
+
| `language` | none (default), or a language code of the tiles such as `de`, `fr`, `ja` | The language of the names; without it, a name in a script other than Latin also shows its Latin form, and other names are English. |
|
|
283
288
|
|
|
284
289
|
`relief` switches layers with a `global-state` expression in `visibility`, which MapLibre GL JS reads from
|
|
285
|
-
5.16.0, and
|
|
286
|
-
older
|
|
290
|
+
5.16.0, and Map Jr. GL from 0.9.0. An
|
|
291
|
+
older Map Jr. GL shows the layers and loads their tiles whatever the state is.
|
|
287
292
|
|
|
288
293
|
**OpenFreeMap styles.** `styles/openfreemap.mjs` builds the five styles of OpenFreeMap with `inlineSprite`: the
|
|
289
294
|
images that a layer can ask for go into the style as plain SVG, and the layers are not changed, except for
|
|
290
295
|
`map-jr:ssr` in their metadata (below).
|
|
291
296
|
|
|
292
297
|
**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
|
|
298
|
+
the first view that the server renderer of Map Jr. GL writes (`renderToSVG`, `renderFirstView`, the `ssr` prop of
|
|
294
299
|
the Vue component), which a page shows inline until the map draws. MapLibre GL JS and the map in the browser ignore
|
|
295
300
|
them. The first view is a placeholder, like a blurred image while the full one loads: it must be small, and it only
|
|
296
301
|
gives the colors and the large shapes of the place. The map draws everything else over it.
|
|
@@ -306,13 +311,14 @@ gives the colors and the large shapes of the place. The map draws everything els
|
|
|
306
311
|
| Roads: minor and service | the same, from zoom 15 | |
|
|
307
312
|
| Names of countries, states, cities and towns | `{"filter": …}` | |
|
|
308
313
|
| 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": …}` |
|
|
314
|
+
| A layer below the zoom where its width or opacity can be seen (0.1 pixel, 5%) | `{"minzoom": …}` | The server does not fetch or read its tiles. (Map Jr. GL 0.8.0 also wrote their paths, which draw nothing.) |
|
|
310
315
|
|
|
311
316
|
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.
|
|
313
|
-
14 on OpenMapTiles: with it, minor
|
|
317
|
+
that its own filter names. The filters are written for Map Jr. GL 0.9.0, which reads `["zoom"]` in a filter as the zoom
|
|
318
|
+
of the render. (Map Jr. GL 0.8.0 reads the zoom of the tile, which is never above 14 on OpenMapTiles: with it, minor
|
|
319
|
+
roads do not show.)
|
|
314
320
|
|
|
315
|
-
Render the placeholder with `tileZoomOffset: 2` (
|
|
321
|
+
Render the placeholder with `tileZoomOffset: 2` (Map Jr. GL 0.9.0 or later): the server builds it from tiles two zooms
|
|
316
322
|
lower, which have fewer and longer features, and fetches fewer tiles.
|
|
317
323
|
|
|
318
324
|
| Over six views and six styles, gzip | `overrides: false` | Placeholder | Placeholder, `tileZoomOffset: 2` |
|
|
@@ -322,10 +328,10 @@ lower, which have fewer and longer features, and fetches fewer tiles.
|
|
|
322
328
|
| Paris at zoom 10 | 67 to 150 KB | 31 to 42 KB | 13 to 18 KB |
|
|
323
329
|
|
|
324
330
|
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
|
|
331
|
+
800 × 500, measured with Map Jr. GL at c4d5e87. A layer whose source style has `map-jr:ssr` keeps it. To render
|
|
326
332
|
without the changes, pass `overrides: false`; to change one layer, pass `overrides: {"<layer id>": {…}}`.
|
|
327
333
|
|
|
328
|
-
**MapLibre styles.** `maplibre` in `lib/maplibre.mjs` builds them from the built
|
|
334
|
+
**MapLibre styles.** `maplibre` in `lib/maplibre.mjs` builds them from the built Map Jr. GL style of each style that
|
|
329
335
|
has a global state `color-scheme`. For each `image` expression it finds the values that the image and its colors can
|
|
330
336
|
depend on: the labels of each `match` in it, and the names of the images, less those that the filter of the layer
|
|
331
337
|
leaves out. It works out the name and the colors for each value, in light and in dark, with the expressions of
|
|
@@ -338,7 +344,7 @@ then checked with `validateStyleMin` of MapLibre.
|
|
|
338
344
|
|
|
339
345
|
`pnpm run preview` draws each style in light and dark, side by side, at the views of `test/views.json` (a range of
|
|
340
346
|
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
|
-
|
|
347
|
+
Map Jr. GL build in `test/lib/`. Pass a style and a view to draw one: `node test/preview.mjs elevation-radar rockies`.
|
|
342
348
|
|
|
343
349
|
`test/maplibre.html` shows a MapLibre style in MapLibre GL JS, with the sprite of the checkout. Serve the repository
|
|
344
350
|
root (`python3 -m http.server 8123`) and open
|