@nika-js/onlymap 0.10.8 → 0.10.10
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 +14 -0
- package/README.md +1 -1
- package/dist/{basemap-BVnjFQjy.js → basemap-BH76eQA0.js} +2 -2
- package/dist/cartograph/element-base.d.ts +9 -0
- package/dist/cartograph/elements/om-atlas.d.ts +24 -0
- package/dist/cartograph/elements/om-legend.d.ts +4 -0
- package/dist/cartograph/render.d.ts +12 -0
- package/dist/cartograph.js +866 -726
- package/dist/cartograph.standalone.js +1768 -1628
- package/dist/{geoparquet-B9T6_4zS.js → geoparquet-DzKLe-0r.js} +1 -1
- package/dist/{globe-view-H-M5WaEA.js → globe-view-B-prUQFh.js} +1 -1
- package/dist/{hillshade-CIVdviss.js → hillshade-CDng2Jsi.js} +1 -1
- package/dist/{index-C2dp0xNz.js → index-8Fj-yh7f.js} +2 -2
- package/dist/{index-DZAIpBqJ.js → index-CIo8LgRZ.js} +3 -3
- package/dist/{index-BmEcYwOm.js → index-CpLydTmE.js} +1 -1
- package/dist/{index-D_sOimHC.js → index-D86S8KJ1.js} +1 -1
- package/dist/{index-D2PbSGEg.js → index-DOfIeNux.js} +1 -1
- package/dist/{index-8Pn7CrwJ.js → index-DvEcTZ4i.js} +18 -18
- package/dist/{index-DZYIEPWK.js → index-Rvd-zFrS.js} +1 -1
- package/dist/{index-BnOXGh3D.js → index-cwieLGSg.js} +1 -1
- package/dist/{index-DlDUl8ad.js → index-laD2SEAB.js} +3 -3
- package/dist/{lerc-By_uKoCw.js → lerc-BJB4-X6n.js} +1 -1
- package/dist/onlymap.standalone.js +1 -1
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-nmzWxY7I.js → post-process-effect-Bd5plkno.js} +1 -1
- package/dist/{raster-2v19l86Q.js → raster-DJ6vvro6.js} +3 -3
- package/dist/{raster-pipeline-BvnoZO-T.js → raster-pipeline-BQhNhrPq.js} +1 -1
- package/dist/{text-on-path-huXjU_aC.js → text-on-path-CrqchF3O.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BTXLI2Nu.js → zarr-oAkG7ZLM.js} +2 -2
- package/docs/cartograph.md +33 -8
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +57 -1
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +1 -1
- package/skills/onlymapjs/references/syntax.md +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,20 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
|
|
|
8
8
|
and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
|
|
9
9
|
version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
|
|
10
10
|
|
|
11
|
+
## 0.10.10 — 2026-09-29
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **A print sheet's colours can now be set attribute by attribute, not only by theme.** The page takes `bg`, `color` and `font`; a legend takes `bg`, `color`, `stroke`, `font-size` and `padding`; the scale bar, north indicator and graticule take `color` — beside the `color`/`bg` text and `fill`/`stroke` shapes always had. Until now a sheet had five themes and a `<style>` block, and an author who wrote `background=` on the page got a warning and no change. Each override is the theme's own property scoped to that element, so the sheet on screen, the printed page and the exported image agree.
|
|
15
|
+
|
|
16
|
+
## 0.10.9 — 2026-09-29
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- **An atlas can now be paged by whoever is reading it.** Open a multi-page atlas anywhere — a browser, an app's preview, an exported file — and turn the pages with `←`/`→`, `PageUp`/`PageDown`, `Home` and `End`, or with the small page control at the foot of the sheet (`‹ 3 / 49 · Alabama ›`). Until now a 49-page atlas showed page one everywhere except an editor with its own controls. The control is on-screen only: it never appears in print or in an exported image, and `pager="none"` on `<om-atlas>` removes it for an app that draws its own.
|
|
20
|
+
- **An app embedding a sheet can drive its atlas from outside.** The sheet posts which page is showing to the window that embeds it, and accepts a page to jump to in return — so a host that shows the sheet in an iframe it cannot reach into can still build a pager for it. Details in the atlas section of the cartograph guide.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- **Validation now catches an `atlas-margin` written in millimetres.** It is a fraction of the feature's extent, the one spatial number in the sheet vocabulary that is not millimetres, and `atlas-margin="10"` pads each page by ten feature-widths — every page a speck. A margin above 2 now warns and names the fix; so does a margin that is not a number, or one set on a frame without `atlas-fit="feature"`, where it does nothing.
|
|
24
|
+
|
|
11
25
|
## 0.10.8 — 2026-09-28
|
|
12
26
|
|
|
13
27
|
### Changed
|
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ Hovering a pickable feature shows a pointer cursor automatically, so recipients
|
|
|
149
149
|
|
|
150
150
|
**Animation:** camera moves accept a duration — `map.flyTo(coords, zoom, { duration: 1200, curve: true })`, or the `fly-to` action (`center`/`zoom`/`pitch`/`bearing`/`duration`) from any behavior or button; `prefers-reduced-motion` is honored (moves become instant, final state identical). Per-prop GPU transitions via the `transition` attribute: `transition="get-fill-color 800ms"` fades color changes; on a streaming layer, `transition="get-position 300ms"` makes entities glide between updates.
|
|
151
151
|
|
|
152
|
-
**Print layouts (cartographs):** the `@nika-js/onlymap/cartograph` entry renders standalone pages measured in millimetres — `<om-cartograph>` holds live or static-georeferenced `<om-frame>`s plus derived legends, graticules, scale bars, north roses, shapes, images and token-driven text; `<om-atlas>` renders one page per feature and exports a ZIP. A frame can name SEVERAL sources (`<om-source>`) and shows the first that actually renders, so a sheet whose live map cannot load where it is opened falls through to a georeferenced capture instead of a blank box, and says which one it chose. Sheets print at true page size (`@page` + print-DPI frame captures) or export as 300 dpi PNG, with bleed/crop-marks/safe-zone press attributes and page-wide colour-vision simulation. It is a separate lazy build entry: the core bundle does not grow, and a static-only sheet never loads the map runtime. Guide: [docs/cartograph.md](docs/cartograph.md).
|
|
152
|
+
**Print layouts (cartographs):** the `@nika-js/onlymap/cartograph` entry renders standalone pages measured in millimetres — `<om-cartograph>` holds live or static-georeferenced `<om-frame>`s plus derived legends, graticules, scale bars, north roses, shapes, images and token-driven text; `<om-atlas>` renders one page per feature and exports a ZIP. A frame can name SEVERAL sources (`<om-source>`) and shows the first that actually renders, so a sheet whose live map cannot load where it is opened falls through to a georeferenced capture instead of a blank box, and says which one it chose. Sheets print at true page size (`@page` + print-DPI frame captures) or export as 300 dpi PNG, with bleed/crop-marks/safe-zone press attributes and page-wide colour-vision simulation. Five built-in themes set the look, and any of it is overridable attribute by attribute — the page's ground, ink and font, a legend's panel colours and text size, the colour of a scale bar, north arrow or graticule — with screen, print and export agreeing. It is a separate lazy build entry: the core bundle does not grow, and a static-only sheet never loads the map runtime. Guide: [docs/cartograph.md](docs/cartograph.md).
|
|
153
153
|
|
|
154
154
|
**Map stories:** a guided tour as markup — `<om-story>` holds `<om-step>` children that fire the same actions behaviors use, on a timeline (`duration`, `delay`, `parallel`); the built-in `type="player"` widget gives play/pause/scrub, seeking restores the scene's captured initial state, one story is active per map, and grabbing the map pauses playback. Effect verbs — `fade`, `pulse`, `trace` (progressive TripsLayer draw-on; with `feature-id`, a single polygon draws itself on inside its own layer), and `populate` (rows drop in one by one via a GPU filter sweep) — work as step shorthands or plain actions. The story is a sibling that references layers by id — delete it and the map is unchanged. For flybys over 3D tilesets, `warm-tiles` pre-loads the route's tiles in the background before playback, and `paced` goes further: the story steps its own clock and never advances a frame while a tileset is still refining, so no frame ever shows unrefined tiles — wall-clock stretches instead (built for recorded takes; emits `om-paced-tick {t, waitedMs}` per frame, and the two compose — warm first, wait less). `npx @nika-js/onlymap record map.html --out flyby.mp4` turns that guarantee into an actual video: one screenshot per paced frame in headless Chromium (widgets and attribution included), assembled with ffmpeg — and effect verbs animate on the story clock, so recorded traces draw on frame by frame exactly as authored. Guide: [docs/stories.md](docs/stories.md).
|
|
155
155
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-
|
|
2
|
-
import { a as ty } from "./globe-view-
|
|
1
|
+
import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-DvEcTZ4i.js";
|
|
2
|
+
import { a as ty } from "./globe-view-B-prUQFh.js";
|
|
3
3
|
var Ou = { exports: {} };
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre GL JS
|
|
@@ -21,6 +21,15 @@ export declare abstract class CartographElementBase extends HTMLElementBase {
|
|
|
21
21
|
protected scheduleRender(): void;
|
|
22
22
|
/** One coalesced render per microtask — subclasses re-read their attributes here. */
|
|
23
23
|
protected abstract renderNow(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Apply an authored colour or font override to the theme property the
|
|
26
|
+
* element's styling reads. Written as the custom property itself — on this
|
|
27
|
+
* element, so it scopes to it — which is what lets one attribute reach the
|
|
28
|
+
* SVG the element draws, its computed style, and so the canvas exporter,
|
|
29
|
+
* which reads computed colour and keeps no second theme table. `alsoColor`
|
|
30
|
+
* writes the element's own `color` too, for painters that read that.
|
|
31
|
+
*/
|
|
32
|
+
protected applyThemeOverride(attr: string, property: string, alsoColor?: boolean): void;
|
|
24
33
|
/** Write the placed-element inline styles from the mm placement attributes. */
|
|
25
34
|
protected applyPlacement(): void;
|
|
26
35
|
}
|
|
@@ -11,6 +11,21 @@ export declare class OmAtlasElement extends CartographElementBase {
|
|
|
11
11
|
private pages;
|
|
12
12
|
private currentIndex;
|
|
13
13
|
private rejection;
|
|
14
|
+
private pager;
|
|
15
|
+
/**
|
|
16
|
+
* Arrow keys page the atlas. This element had `seek()`, `next()` and an
|
|
17
|
+
* event, and no way for a READER to use any of them: a 49-page atlas opened
|
|
18
|
+
* in a preview, a browser or an exported file showed page one and could not
|
|
19
|
+
* be moved off it. Bound as fields so the exact function is removed again.
|
|
20
|
+
*/
|
|
21
|
+
private readonly onKeyDown;
|
|
22
|
+
/**
|
|
23
|
+
* A parent window may drive the atlas: `{ source: "onlymap-cartograph-host",
|
|
24
|
+
* type: "atlas-seek", index }`. This is what lets a host that shows the
|
|
25
|
+
* sheet in a CROSS-ORIGIN iframe — where it cannot reach `seek()` — page it
|
|
26
|
+
* anyway. Any window can post this; the worst it can do is turn a page.
|
|
27
|
+
*/
|
|
28
|
+
private readonly onHostMessage;
|
|
14
29
|
/** The frame whose layer drives the iteration — the same `for=` rule every furniture element follows. */
|
|
15
30
|
get frame(): OmFrameElement | null;
|
|
16
31
|
get count(): number;
|
|
@@ -43,5 +58,14 @@ export declare class OmAtlasElement extends CartographElementBase {
|
|
|
43
58
|
seek(index: number): void;
|
|
44
59
|
next(): void;
|
|
45
60
|
private applyPage;
|
|
61
|
+
/**
|
|
62
|
+
* Draw (or update) the reader's page control on the owning sheet:
|
|
63
|
+
* `‹ 3 / 49 · Alabama ›`. Find-or-create, like the page's own overlays, so
|
|
64
|
+
* paging updates one element rather than stacking them. `pager="none"`
|
|
65
|
+
* removes it for a host that draws its own.
|
|
66
|
+
*/
|
|
67
|
+
private renderPager;
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
46
70
|
protected renderNow(): void;
|
|
47
71
|
}
|
|
@@ -6,6 +6,10 @@ export declare class OmLegendElement extends CartographElementBase implements Ca
|
|
|
6
6
|
get derived(): boolean;
|
|
7
7
|
/** The rows this legend currently shows — recomputed on demand, never stored. */
|
|
8
8
|
get rows(): LegendRow[];
|
|
9
|
+
/** Inner padding in mm — authored, else the 2 mm the theme always used. */
|
|
10
|
+
private get paddingMm();
|
|
11
|
+
/** Row text size in mm — `font-size` is authored in points, like <om-text>. */
|
|
12
|
+
private get fontMm();
|
|
9
13
|
protected renderNow(): void;
|
|
10
14
|
private renderRows;
|
|
11
15
|
private buildRow;
|
|
@@ -34,6 +34,18 @@ export interface RenderCartographResult {
|
|
|
34
34
|
/** Non-fatal problems worth surfacing to the user (clamping, skipped frames). */
|
|
35
35
|
warnings: string[];
|
|
36
36
|
}
|
|
37
|
+
/** Document order, with `z` as an override — the same rule the DOM paints by. */
|
|
38
|
+
/**
|
|
39
|
+
* Does this page child belong in an exported image?
|
|
40
|
+
*
|
|
41
|
+
* Anything marked screen-only does not: the atlas pager, and any future
|
|
42
|
+
* on-screen control. The rule used to be enforced only for the safe-zone
|
|
43
|
+
* guide, by skipping the whole marks overlay it lives in; a screen-only node
|
|
44
|
+
* placed directly on the page would have been painted into a PNG regardless of
|
|
45
|
+
* the mark it carried. The print stylesheet and the host's persistence filter
|
|
46
|
+
* already honour the mark; now the exporter does too.
|
|
47
|
+
*/
|
|
48
|
+
export declare function paintsInExport(el: Element): boolean;
|
|
37
49
|
export declare function renderCartograph(page?: OmCartographElement | null, options?: RenderCartographOptions): Promise<RenderCartographResult>;
|
|
38
50
|
export interface RenderAtlasOptions extends RenderCartographOptions {
|
|
39
51
|
/** Render only this page (0-based) — the host contract for `?export=&page=i`. */
|