@nika-js/onlymap 0.11.3 → 0.11.5
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 +16 -0
- package/README.md +2 -2
- package/dist/{basemap-C6Ehu6fw.js → basemap-CnjAGLZo.js} +14 -2
- package/dist/basemap.d.ts +9 -0
- package/dist/cartograph.js +231 -229
- package/dist/cartograph.standalone.js +361 -359
- package/dist/elements/om-map.d.ts +31 -1
- package/dist/elements/om-overlay.d.ts +0 -14
- package/dist/{geoparquet-3V4KrvQN.js → geoparquet-CHtunmD2.js} +1 -1
- package/dist/{globe-view-D4Tlyff-.js → globe-view-CgQa-07O.js} +1 -1
- package/dist/{hillshade-BC8QiJRP.js → hillshade-BgXgVdjg.js} +1 -1
- package/dist/{index-pu3BNjzA.js → index-BTTCf4nb.js} +5488 -5305
- package/dist/{index-BUE-VzWx.js → index-BTsRqhXB.js} +1 -1
- package/dist/{index-p5XXAoNa.js → index-ClLMdW3k.js} +2 -2
- package/dist/{index-BPCIxI1b.js → index-D4x57ql0.js} +1 -1
- package/dist/{index-iwTA46AA.js → index-DjtM8ecq.js} +1 -1
- package/dist/{index-C1f14saD.js → index-DoNtp5Nh.js} +3 -3
- package/dist/{index-DpUl6z5-.js → index-NCXX8bDe.js} +1 -1
- package/dist/{index-BqFwoWp9.js → index-aOe9cOFs.js} +1 -1
- package/dist/{index-DgutJ5y2.js → index-k7l7kqTk.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-DWtJKNQk.js → lerc-BtdiMDO7.js} +1 -1
- package/dist/onlymap.standalone.js +13650 -13455
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-mQdMaWQE.js → post-process-effect-BWrq5IR8.js} +1 -1
- package/dist/programmatic.d.ts +10 -1
- package/dist/{raster-DtUDOXfy.js → raster-iGwPuAgo.js} +3 -3
- package/dist/{raster-pipeline-hQh5cG3e.js → raster-pipeline-Dxs9TpD6.js} +1 -1
- package/dist/react.js +128 -125
- package/dist/runtime-core.d.ts +50 -1
- package/dist/selection.d.ts +31 -0
- package/dist/{text-on-path-CcfoZqXD.js → text-on-path-C8h_3Snf.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/viewport-cull.d.ts +15 -0
- package/dist/{zarr-Qo4A_t7d.js → zarr-C1zXD9VD.js} +2 -2
- package/docs/cartograph.md +8 -3
- package/llms.txt +3 -2
- package/onlymapjs.html-data.json +4 -0
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +3 -2
- package/skills/onlymapjs/references/syntax.md +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,22 @@ 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.5 — 2026-10-02
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Ask the map what is under the pointer, without editing it.** `mapEl.pickAt([x, y])` returns the feature at a screen point and `mapEl.pickRect({x, y, width, height})` every feature inside a box, so a tool can build box-select or tell an assistant which feature you mean. They don't change the selection or set off your behaviours and tooltips.
|
|
15
|
+
- **A picker can reach every layer for as long as it is open.** Set `mapEl.pickMode = "all"` while your tool is active, and layers you never made `pickable` answer too. Nothing is written into your map, so there is nothing to undo or save.
|
|
16
|
+
- **`mapEl.unproject([x, y])`** turns a screen point into a longitude and latitude, and `mapEl.project([lng, lat])` goes the other way. All of these are on `MapController` as well.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- **Popups now appear on maps in a projected coordinate system (`crs=`), including projected frames on a print sheet.** Every `<om-overlay>`, including click popups, was hidden there because the map's flat camera was mistaken for one looking away from the point.
|
|
20
|
+
- **Clicking a feature on a projected map reports its longitude and latitude.** The click used to report the map's internal metres, so `zoom-to-feature` and anything else reading the clicked position went to the wrong place.
|
|
21
|
+
|
|
22
|
+
## 0.11.4 — 2026-10-01
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **A fallback capture is credited on the sheet.** When a frame falls back to its saved capture because the live map didn't load, the sheet now credits that capture's basemap providers instead of printing none. A capture `<om-source>` takes the same `attribution` attribute as a frozen frame; record it when you take the capture, alongside its `corners`.
|
|
26
|
+
|
|
11
27
|
## 0.11.3 — 2026-10-01
|
|
12
28
|
|
|
13
29
|
### Changed
|
package/README.md
CHANGED
|
@@ -404,8 +404,8 @@ 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); `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
|
-
- **`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
|
|
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; `pickAt([x, y])` / `pickRect({x, y, width, height})` ask what is under a pixel or inside a screen rectangle and `unproject([x, y])` / `project([lng, lat])` convert between pixels and coordinates — queries that leave the selection, `om-map-point` and behaviors alone, with a `pickMode` property (`"authored"` | `"all"`) that lets a picker tool reach layers the author did not make `pickable` without editing the document; `document.querySelector("om-map")` is fully typed
|
|
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 same `pickAt`/`pickRect`/`unproject`/`pickMode` the element has are on the controller. 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)
|
|
411
411
|
|
|
@@ -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-BTTCf4nb.js";
|
|
2
|
+
import { a as ty } from "./globe-view-CgQa-07O.js";
|
|
3
3
|
const iy = {
|
|
4
4
|
copy: "©",
|
|
5
5
|
reg: "®",
|
|
@@ -25100,6 +25100,14 @@ class xy {
|
|
|
25100
25100
|
getOverlayDeckInternal() {
|
|
25101
25101
|
return this.overlay._deck;
|
|
25102
25102
|
}
|
|
25103
|
+
/**
|
|
25104
|
+
* Programmatic picking (docs/design/pick-api.md) — the overlay forwards
|
|
25105
|
+
* deck's own pick methods, but asserts its internal Deck exists, so hand it
|
|
25106
|
+
* out only once that Deck does.
|
|
25107
|
+
*/
|
|
25108
|
+
getPickerInternal() {
|
|
25109
|
+
return this.getOverlayDeckInternal() ? this.overlay : void 0;
|
|
25110
|
+
}
|
|
25103
25111
|
/** The MapLibre canvas — the pick-cursor affordance writes its cursor style (issue #33). */
|
|
25104
25112
|
getCanvasElement() {
|
|
25105
25113
|
return this.map.getCanvas();
|
|
@@ -25292,6 +25300,10 @@ class xy {
|
|
|
25292
25300
|
const Ee = Q.project([ge[0], ge[1]]);
|
|
25293
25301
|
return [Ee.x, Ee.y];
|
|
25294
25302
|
},
|
|
25303
|
+
unproject: (ge) => {
|
|
25304
|
+
const Ee = Q.unproject([ge[0], ge[1]]);
|
|
25305
|
+
return [Ee.lng, Ee.lat];
|
|
25306
|
+
},
|
|
25295
25307
|
getBounds: () => {
|
|
25296
25308
|
const ge = Q.getBounds();
|
|
25297
25309
|
return [ge.getWest(), ge.getSouth(), ge.getEast(), ge.getNorth()];
|
package/dist/basemap.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
2
|
+
import { MapboxOverlay } from "@deck.gl/mapbox";
|
|
2
3
|
import type { DeckProps, Viewport } from "@deck.gl/core";
|
|
3
4
|
import type { ResolvedBasemap } from "./basemap-registry";
|
|
4
5
|
import type { ViewOrigin } from "./external-store";
|
|
5
6
|
export interface ViewportLike {
|
|
6
7
|
project(xyz: number[]): number[];
|
|
8
|
+
/** Screen pixel → `[lng, lat]` (programmatic picking, docs/design/pick-api.md). */
|
|
9
|
+
unproject(xy: number[]): number[];
|
|
7
10
|
getBounds(): [number, number, number, number];
|
|
8
11
|
width: number;
|
|
9
12
|
height: number;
|
|
@@ -69,6 +72,12 @@ export declare class MapLibreBasemapAdapter {
|
|
|
69
72
|
private markBusy;
|
|
70
73
|
/** The overlay's internal Deck instance — the hover-pick gate wraps its pointermove handler (issue #31); same exact-pin `_deck` seam as getDeckLayers below. */
|
|
71
74
|
getOverlayDeckInternal(): unknown;
|
|
75
|
+
/**
|
|
76
|
+
* Programmatic picking (docs/design/pick-api.md) — the overlay forwards
|
|
77
|
+
* deck's own pick methods, but asserts its internal Deck exists, so hand it
|
|
78
|
+
* out only once that Deck does.
|
|
79
|
+
*/
|
|
80
|
+
getPickerInternal(): Pick<MapboxOverlay, "pickObject" | "pickMultipleObjects" | "pickObjects"> | undefined;
|
|
72
81
|
/** The MapLibre canvas — the pick-cursor affordance writes its cursor style (issue #33). */
|
|
73
82
|
getCanvasElement(): HTMLElement;
|
|
74
83
|
/** The overlay deck's live layers — whenSettled's readiness gate (issue #37). */
|