@nika-js/onlymap 0.11.2 → 0.11.3
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 +10 -0
- package/README.md +2 -2
- package/dist/attribution.d.ts +27 -0
- package/dist/{basemap-BlMlSRTo.js → basemap-C6Ehu6fw.js} +923 -878
- package/dist/basemap.d.ts +11 -0
- package/dist/cartograph/elements/om-cartograph.d.ts +22 -0
- package/dist/cartograph/elements/om-frame.d.ts +8 -0
- package/dist/cartograph.js +1139 -1058
- package/dist/cartograph.standalone.js +1595 -1514
- package/dist/elements/om-map.d.ts +6 -0
- package/dist/{geoparquet-Bqhh_idk.js → geoparquet-3V4KrvQN.js} +1 -1
- package/dist/{globe-view-DQ0GLKSn.js → globe-view-D4Tlyff-.js} +1 -1
- package/dist/{hillshade-CxMG6ocE.js → hillshade-BC8QiJRP.js} +1 -1
- package/dist/{index-m-7enOKi.js → index-BPCIxI1b.js} +1 -1
- package/dist/{index-9W2ZrRyF.js → index-BUE-VzWx.js} +1 -1
- package/dist/{index-DklXFu6D.js → index-BqFwoWp9.js} +1 -1
- package/dist/{index-DO3-mfIk.js → index-C1f14saD.js} +3 -3
- package/dist/{index-DBYIrdvb.js → index-DgutJ5y2.js} +3 -3
- package/dist/{index-CdAb2VR8.js → index-DpUl6z5-.js} +1 -1
- package/dist/{index-aoMhS8VK.js → index-iwTA46AA.js} +1 -1
- package/dist/{index-CF7q_mKH.js → index-p5XXAoNa.js} +2 -2
- package/dist/{index-CE3n5pQz.js → index-pu3BNjzA.js} +51 -20
- package/dist/{lerc-vNjPdkTs.js → lerc-DWtJKNQk.js} +1 -1
- package/dist/onlymap.standalone.js +306 -231
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-eVlcdR0m.js → post-process-effect-mQdMaWQE.js} +1 -1
- package/dist/{raster-8iVEbDdp.js → raster-DtUDOXfy.js} +3 -3
- package/dist/{raster-pipeline-OqdVks6Y.js → raster-pipeline-hQh5cG3e.js} +1 -1
- package/dist/runtime-core.d.ts +22 -0
- package/dist/{text-on-path-C34MMnKY.js → text-on-path-CcfoZqXD.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-Dla-EY4o.js → zarr-Qo4A_t7d.js} +2 -2
- package/docs/cartograph.md +27 -3
- package/llms.txt +2 -2
- package/onlymapjs.html-data.json +4 -0
- 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,16 @@ 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.11.3 — 2026-10-01
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- **Basemap credits on a print sheet move off the maps and into a corner of the page.** A map inside a cartograph frame no longer shows its own OpenStreetMap / CARTO attribution; the sheet credits every provider once, at the bottom-right, the same way it already carries the OnlyMap credit instead of a badge per frame. Three frames on one basemap now print one credit, and small insets keep their whole picture.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- **Frozen frames keep their basemap credit.** Freezing a frame records its providers in a new `attribution` attribute on `<om-frame>`, so a static or exported sheet still credits its tiles with nothing loaded. You can set the attribute yourself on a placed image whose tiles need credit.
|
|
18
|
+
- **A provider you already credit is not printed twice.** If your own attribution text names OpenStreetMap or CARTO, the sheet leaves that provider out of its line.
|
|
19
|
+
- **`mapEl.attributions()`** returns a map's basemap providers as plain text, and the `om-attributions-changed` event fires when they change — for exports and print layouts that render credits themselves.
|
|
20
|
+
|
|
11
21
|
## 0.11.2 — 2026-10-01
|
|
12
22
|
|
|
13
23
|
### Added
|
package/README.md
CHANGED
|
@@ -161,7 +161,7 @@ Hovering a pickable feature shows a pointer cursor automatically, so recipients
|
|
|
161
161
|
|
|
162
162
|
**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.
|
|
163
163
|
|
|
164
|
-
**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).
|
|
164
|
+
**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. Basemap attribution moves off the frames onto the sheet — every provider credited once, in a corner, frozen frames included. 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).
|
|
165
165
|
|
|
166
166
|
**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).
|
|
167
167
|
|
|
@@ -404,7 +404,7 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
|
|
|
404
404
|
|
|
405
405
|
- **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
|
|
406
406
|
- **`@nika-js/onlymap/deck`** — the bundled deck.gl classes (`CompositeLayer`, `TileLayer`, …) for building custom layer types: shims must extend the same class hierarchy the core renders with, not a second installed deck.gl copy. Recipe: [docs/custom-layers.md](docs/custom-layers.md)
|
|
407
|
-
- **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `document.querySelector("om-map")` is fully typed
|
|
407
|
+
- **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); `attributions()` (the basemap's providers as plain text — what an export must credit; the bubbling `om-attributions-changed` event fires when a style loads); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `document.querySelector("om-map")` is fully typed
|
|
408
408
|
- **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `setEffects` (deck `Effect` instances, 1:1 — takes precedence over the document's `<om-effect>` chain while set; `null` hands the chain back), `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` options (the `om-map-point` / `om-tileset-load` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The React adapter rides the function form; vanilla/native hosts may use either
|
|
409
409
|
- **`getStore(token)`** — the external-store contract: per-token `{subscribe, getSnapshot}` stores (`viewport`/`selection`/`layers`/`data:<id>`) with cached immutable plain-data snapshots and `origin` tagging — directly consumable by `useSyncExternalStore` (the React adapter's own hooks ride it), MobX autoruns, Redux listeners, Zustand mirrors. ~20-line integration-tested recipes for Redux Toolkit, MobX/mobx-keystone, Zustand, and Jotai: [docs/external-stores.md](docs/external-stores.md)
|
|
410
410
|
- **Testing** — `mountForTest`, and imports are SSR-safe (importing in Node/jsdom never touches browser globals)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basemap attribution as plain text — the form a printed sheet can carry.
|
|
3
|
+
*
|
|
4
|
+
* A style's sources declare their attribution as HTML (`<a href=…>© OpenStreetMap</a>
|
|
5
|
+
* contributors`), which is right for a live map with clickable credits and
|
|
6
|
+
* wrong for paper. A cartograph moves every frame's attribution to one line on
|
|
7
|
+
* the page, so it needs the text, de-duplicated across frames that share a
|
|
8
|
+
* provider.
|
|
9
|
+
*
|
|
10
|
+
* Pure and dependency-free on purpose: both the core (which reads the style)
|
|
11
|
+
* and the cartograph extension (which must never load the core to render a
|
|
12
|
+
* static sheet) import it.
|
|
13
|
+
*/
|
|
14
|
+
/** Joins one sheet's attributions; also how a frozen frame stores them in its `attribution` attribute. */
|
|
15
|
+
export declare const ATTRIBUTION_SEPARATOR = " \u00B7 ";
|
|
16
|
+
/** One attribution string, HTML or not, as a single line of text. */
|
|
17
|
+
export declare function attributionText(html: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Every distinct attribution among `values`, as text.
|
|
20
|
+
*
|
|
21
|
+
* Non-strings and empty strings are dropped, and so is any entry another entry
|
|
22
|
+
* already contains — MapLibre's own rule, which keeps "© OpenStreetMap" from
|
|
23
|
+
* printing beside "© OpenStreetMap contributors".
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeAttributions(values: readonly unknown[]): string[];
|
|
26
|
+
/** The inverse of joining with {@link ATTRIBUTION_SEPARATOR}: an `attribution` attribute back to its entries. */
|
|
27
|
+
export declare function parseAttributionAttribute(value: string | null | undefined): string[];
|