@nika-js/onlymap 0.7.6 → 0.8.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 +10 -0
- package/README.md +3 -1
- package/dist/{LercDecode.es-sRuTJq5Y.js → LercDecode.es--DH6_OFE.js} +1 -1
- package/dist/{basemap-BCGMmc2F.js → basemap-2ZZ_9gFn.js} +528 -502
- package/dist/basemap.d.ts +15 -0
- package/dist/cartograph/api.d.ts +45 -0
- package/dist/cartograph/atlas.d.ts +50 -0
- package/dist/cartograph/core-loader.d.ts +35 -0
- package/dist/cartograph/cvd.d.ts +106 -0
- package/dist/cartograph/element-base.d.ts +26 -0
- package/dist/cartograph/elements/om-atlas.d.ts +47 -0
- package/dist/cartograph/elements/om-cartograph.d.ts +76 -0
- package/dist/cartograph/elements/om-frame.d.ts +111 -0
- package/dist/cartograph/elements/om-graticule.d.ts +24 -0
- package/dist/cartograph/elements/om-image.d.ts +12 -0
- package/dist/cartograph/elements/om-legend.d.ts +16 -0
- package/dist/cartograph/elements/om-north.d.ts +11 -0
- package/dist/cartograph/elements/om-scalebar.d.ts +13 -0
- package/dist/cartograph/elements/om-shape.d.ts +16 -0
- package/dist/cartograph/elements/om-text.d.ts +9 -0
- package/dist/cartograph/georef.d.ts +126 -0
- package/dist/cartograph/graticule.d.ts +70 -0
- package/dist/cartograph/html-data.d.ts +27 -0
- package/dist/cartograph/index.d.ts +1 -0
- package/dist/cartograph/layout.d.ts +23 -0
- package/dist/cartograph/legend.d.ts +75 -0
- package/dist/cartograph/live-frame.d.ts +69 -0
- package/dist/cartograph/paint.d.ts +54 -0
- package/dist/cartograph/refs.d.ts +33 -0
- package/dist/cartograph/render.d.ts +64 -0
- package/dist/cartograph/scalebar.d.ts +91 -0
- package/dist/cartograph/schema.d.ts +38 -0
- package/dist/cartograph/standalone.d.ts +1 -0
- package/dist/cartograph/textlayout.d.ts +45 -0
- package/dist/cartograph/tokens.d.ts +45 -0
- package/dist/cartograph/url-actions.d.ts +26 -0
- package/dist/cartograph/validate.d.ts +38 -0
- package/dist/cartograph/zip.d.ts +22 -0
- package/dist/cartograph.css +1 -0
- package/dist/cartograph.js +2768 -0
- package/dist/cartograph.standalone.js +7640 -0
- package/dist/crs-DsDQ4Q4i.js +71 -0
- package/dist/download.d.ts +6 -0
- package/dist/feature-access.d.ts +14 -0
- package/dist/field-access.d.ts +1 -10
- package/dist/{geoparquet-CK9IjEjH.js → geoparquet-DDZzee5Z.js} +1 -1
- package/dist/{index-CNRYpb0x.js → index-BGOblzWN.js} +5134 -5070
- package/dist/index-CcLC9jE5.js +4798 -0
- package/dist/{index-CIEJyv5x.js → index-CeoVzd6t.js} +1 -1
- package/dist/{index-CW3bdfHB.js → index-Cz1VsWzO.js} +2 -2
- package/dist/{index-CN_tn36D.js → index-DkxFFflv.js} +1 -1
- package/dist/{index-C1ZQGJxa.js → index-DphcuoPv.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-Bb2JZ92v.js → lerc-D7TfTy6l.js} +2 -2
- package/dist/onlymap.standalone.js +8820 -8730
- package/dist/onlymapjs.js +12 -11
- package/dist/{raster-DpYssEe7.js → raster-D_3YKFZz.js} +3 -3
- package/dist/{raster-pipeline-BVCB-0yq.js → raster-pipeline-D1yeoJo2.js} +1 -1
- package/dist/runtime-core.d.ts +30 -0
- package/dist/snapshot.d.ts +17 -0
- package/dist/units.d.ts +9 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-DNb4iqbL.js → zarr-DH5Ntt5U.js} +2 -2
- package/docs/cartograph.md +396 -0
- package/llms.txt +1 -0
- package/onlymapjs.html-data.json +974 -0
- package/package.json +13 -2
- package/skills/onlymapjs/SKILL.md +2 -2
- package/skills/onlymapjs/references/syntax.md +26 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nika-js/onlymap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Declarative deck.gl maps for HTML and React — interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"publishConfig": {
|
|
@@ -74,6 +74,17 @@
|
|
|
74
74
|
"import": "./dist/onlymap.standalone.js",
|
|
75
75
|
"default": "./dist/onlymap.standalone.js"
|
|
76
76
|
},
|
|
77
|
+
"./cartograph": {
|
|
78
|
+
"types": "./dist/cartograph/index.d.ts",
|
|
79
|
+
"import": "./dist/cartograph.js",
|
|
80
|
+
"default": "./dist/cartograph.js"
|
|
81
|
+
},
|
|
82
|
+
"./cartograph/standalone": {
|
|
83
|
+
"types": "./dist/cartograph/standalone.d.ts",
|
|
84
|
+
"import": "./dist/cartograph.standalone.js",
|
|
85
|
+
"default": "./dist/cartograph.standalone.js"
|
|
86
|
+
},
|
|
87
|
+
"./cartograph.css": "./dist/cartograph.css",
|
|
77
88
|
"./onlymapjs.css": "./dist/onlymapjs.css",
|
|
78
89
|
"./style.css": "./dist/style.css",
|
|
79
90
|
"./onlymapjs.html-data.json": "./onlymapjs.html-data.json",
|
|
@@ -108,7 +119,7 @@
|
|
|
108
119
|
],
|
|
109
120
|
"scripts": {
|
|
110
121
|
"dev": "vite",
|
|
111
|
-
"build": "npm run typecheck && npm run gen:licenses && vite build && vite build --config vite.react.config.ts && vite build --config vite.deck.config.ts && vite build --config vite.standalone.config.ts && node dev/assert-bundle-cdn-safe.mjs && npm run build:types",
|
|
122
|
+
"build": "npm run typecheck && npm run gen:licenses && vite build && vite build --config vite.react.config.ts && vite build --config vite.deck.config.ts && vite build --config vite.standalone.config.ts && vite build --config vite.cartograph.config.ts && vite build --config vite.cartograph-standalone.config.ts && node dev/assert-bundle-cdn-safe.mjs && npm run build:types",
|
|
112
123
|
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
113
124
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.e2e.json --noEmit && tsc -p cloud/workers/telemetry/tsconfig.json && tsc -p cloud/workers/examples/tsconfig.json",
|
|
114
125
|
"test": "vitest run",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: onlymapjs
|
|
3
|
-
description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a
|
|
3
|
+
description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# OnlyMapJS
|
|
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
|
|
|
23
23
|
</script>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.
|
|
26
|
+
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.8.0` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.8.0/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
|
|
27
27
|
|
|
28
28
|
## React Projects
|
|
29
29
|
|
|
@@ -16,8 +16,8 @@ Vite/npm project:
|
|
|
16
16
|
Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.
|
|
20
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.
|
|
19
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.8.0/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.8.0"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).
|
|
@@ -622,6 +622,30 @@ Example:
|
|
|
622
622
|
|
|
623
623
|
|
|
624
624
|
|
|
625
|
+
### Cartographs (`@nika-js/onlymap/cartograph` — print layouts)
|
|
626
|
+
|
|
627
|
+
A separate lazy entry (`import "@nika-js/onlymap/cartograph"`; CDN: `https://unpkg.com/@nika-js/onlymap/dist/cartograph.standalone.js`). Pages are measured in millimetres and print at true size.
|
|
628
|
+
|
|
629
|
+
```html
|
|
630
|
+
<om-cartograph size="A3" orientation="landscape" title="Parcel survey" dpi="300">
|
|
631
|
+
<om-text kind="title" x="10" y="8" w="250" h="12">{{title}}</om-text>
|
|
632
|
+
<om-frame id="main" x="24" y="28" w="236" h="196" center="[103.81, 1.31]" zoom="14.4">
|
|
633
|
+
<om-map basemap="none">…layers…</om-map>
|
|
634
|
+
</om-frame>
|
|
635
|
+
<om-legend for="main" x="270" y="84" w="60" h="62" title="Legend"></om-legend>
|
|
636
|
+
<om-scalebar for="main" x="10" y="230" w="72" h="10" units="metric"></om-scalebar>
|
|
637
|
+
<om-north for="main" x="238" y="226" w="16" h="18" kind="rose"></om-north>
|
|
638
|
+
<om-graticule for="main" x="24" y="28" w="236" h="196" interval="0.005" labels="outside"></om-graticule>
|
|
639
|
+
</om-cartograph>
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
- Frames: live (`<om-map>` child, the FRAME's camera attributes win) or `mode="static"` with `crs` + `corners` for a georeferenced raster. `overview-of="<frame-id>"` draws a locator footprint.
|
|
643
|
+
- `<om-legend for>` derives rows from the live map's own symbology (classified breaks included); literal rows via `derived="false"` + `<om-legend-row>` children.
|
|
644
|
+
- `<om-atlas for="<frame-id>" layer="<layer-id>">` renders one page per feature sequentially and exports a ZIP.
|
|
645
|
+
- Output: `page.print()` / `?print=1` (PDF at page size), `renderCartograph(page, {dpi})` / `?export=png&dpi=300` (PNG). Press attributes: `bleed`, `crop-marks`, `safe-zone` (screen-only), `flatten`. `cvd="deuteranopia|…"` simulates colour-vision deficiency; `lintLegendColours()` flags collapsing palettes.
|
|
646
|
+
- Free plan injects a small foot credit — suppressed by an authored `om-text` crediting OnlyMap or a paid key on a live frame's map.
|
|
647
|
+
- Deep reference: `docs/cartograph.md`.
|
|
648
|
+
|
|
625
649
|
### `<om-fallback>`
|
|
626
650
|
|
|
627
651
|
Static content shown only where scripts never run — chat-app/email file previews (iOS QuickLook), file managers, sandboxed webviews. Hidden automatically once the map boots. Good practice on every complete page, especially one that may be shared as a file.
|