@nika-js/onlymap 0.8.0 → 0.8.2
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 +15 -0
- package/dist/{LercDecode.es--DH6_OFE.js → LercDecode.es-BSylOuVc.js} +1 -1
- package/dist/{basemap-2ZZ_9gFn.js → basemap-CMaYhtEE.js} +11 -1
- package/dist/basemap.d.ts +8 -0
- package/dist/cartograph/api.d.ts +1 -1
- package/dist/cartograph/elements/om-frame.d.ts +18 -0
- package/dist/cartograph/live-frame.d.ts +14 -0
- package/dist/cartograph.js +419 -378
- package/dist/cartograph.standalone.js +1158 -1117
- package/dist/elements/om-map.d.ts +2 -0
- package/dist/{geoparquet-DDZzee5Z.js → geoparquet-DZjsJtQQ.js} +1 -1
- package/dist/{index-DphcuoPv.js → index-BQkmbcQr.js} +1 -1
- package/dist/{index-BGOblzWN.js → index-Cw9SL11B.js} +1347 -1315
- package/dist/{index-DkxFFflv.js → index-DRFEoCuu.js} +1 -1
- package/dist/{index-Cz1VsWzO.js → index-Dl0UKZF-.js} +2 -2
- package/dist/{index-CeoVzd6t.js → index-tSk19VJe.js} +1 -1
- package/dist/{lerc-D7TfTy6l.js → lerc-Dphd_hZG.js} +2 -2
- package/dist/onlymap.standalone.js +2232 -2190
- package/dist/onlymapjs.js +1 -1
- package/dist/{raster-D_3YKFZz.js → raster-Bb9CjpGL.js} +3 -3
- package/dist/{raster-pipeline-D1yeoJo2.js → raster-pipeline-D_Hw3Wax.js} +1 -1
- package/dist/runtime-core.d.ts +12 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-DH5Ntt5U.js → zarr-DJA83o9G.js} +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +4 -0
- package/package.json +5 -5
- package/skills/onlymapjs/references/syntax.md +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,21 @@ 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.8.2 — 2026-09-18
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **The tilt limit on a cartograph frame now actually holds.** 0.8.1 worked out how far each frame could tilt and then, on any map with a basemap, failed to tell the map about it — so the camera could still be pushed to a near-horizontal angle where the frame loses its georeference, and with it the scale bar, north arrow, graticule and export. It now holds on every map, and survives switching the basemap.
|
|
15
|
+
- **The limit follows the map instead of being fixed when the frame loads.** Zooming out makes a frame able to tilt less, not more; the ceiling now tightens and loosens as you move the map, rather than staying at whatever the frame was showing when it opened.
|
|
16
|
+
|
|
17
|
+
## 0.8.1 — 2026-09-18
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- **A frame that used to show a captured image no longer shows it behind a live map.** Switching a cartograph frame back to live left its old capture drawing underneath, so the map appeared to have a ghost of itself behind it at low tilt. The capture is kept — switching back to static restores it — but it stays out of sight while the frame is live.
|
|
21
|
+
- **A frame can no longer be tilted past the point where it stops working.** Tilt far enough and a frame's top edge reaches the horizon, which leaves it with no georeference — and without that, no scale bar, no north arrow, no graticule and no export. The tilt now stops at whatever that frame can still handle, which depends on its shape and zoom: a wide frame tilts further than a tall one, and zooming in lets both tilt further.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **`max-pitch` on `<om-map>`** caps how far a map can be tilted, in degrees. Useful for a kiosk or an embedded map that should stay roughly upright. It is applied to the controls, so an over-tilt is simply refused rather than snapping back after the fact.
|
|
25
|
+
|
|
11
26
|
## 0.8.0 — 2026-09-11
|
|
12
27
|
|
|
13
28
|
### Added
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-
|
|
1
|
+
import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-Cw9SL11B.js";
|
|
2
2
|
const Cd = Math.PI / 180, gy = 180 / Math.PI;
|
|
3
3
|
function em(Pe, K = 0) {
|
|
4
4
|
const pe = Math.min(180, Pe) * Cd;
|
|
@@ -25321,6 +25321,16 @@ class Ry {
|
|
|
25321
25321
|
setInteractive(K) {
|
|
25322
25322
|
K.doubleClickZoom === !1 ? this.map.doubleClickZoom.disable() : K.doubleClickZoom === !0 && this.map.doubleClickZoom.enable(), K.dragPan === !1 ? this.map.dragPan.disable() : K.dragPan === !0 && this.map.dragPan.enable();
|
|
25323
25323
|
}
|
|
25324
|
+
/**
|
|
25325
|
+
* Cap how far the user can tilt. Null restores MapLibre's own maximum.
|
|
25326
|
+
*
|
|
25327
|
+
* A cap belongs on the CONTROLLER, not on the camera: clamping a pitch after
|
|
25328
|
+
* the gesture has produced it means the view visibly overshoots and springs
|
|
25329
|
+
* back, while a controller maximum simply refuses to go further.
|
|
25330
|
+
*/
|
|
25331
|
+
setMaxPitch(K) {
|
|
25332
|
+
this.map.setMaxPitch(K ?? 85);
|
|
25333
|
+
}
|
|
25324
25334
|
isLoaded() {
|
|
25325
25335
|
return this.initialized;
|
|
25326
25336
|
}
|
package/dist/basemap.d.ts
CHANGED
|
@@ -154,6 +154,14 @@ export declare class MapLibreBasemapAdapter {
|
|
|
154
154
|
doubleClickZoom?: boolean;
|
|
155
155
|
dragPan?: boolean;
|
|
156
156
|
}): void;
|
|
157
|
+
/**
|
|
158
|
+
* Cap how far the user can tilt. Null restores MapLibre's own maximum.
|
|
159
|
+
*
|
|
160
|
+
* A cap belongs on the CONTROLLER, not on the camera: clamping a pitch after
|
|
161
|
+
* the gesture has produced it means the view visibly overshoots and springs
|
|
162
|
+
* back, while a controller maximum simply refuses to go further.
|
|
163
|
+
*/
|
|
164
|
+
setMaxPitch(maxPitch: number | null): void;
|
|
157
165
|
isLoaded(): boolean;
|
|
158
166
|
getViewport(): ViewportLike;
|
|
159
167
|
getViewState(): BasemapViewState;
|
package/dist/cartograph/api.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { deriveLegendRows, readOverrides, readLiteralRows, swatchShapeFor, rowCo
|
|
|
29
29
|
export { buildGraticule, niceInterval, formatDms, GEOGRAPHIC_PLANE, type Graticule, type GridPlane } from "./graticule";
|
|
30
30
|
export { lintLegendColours, simulate, deltaE00, parseColor, ensureCvdFilters, applyCvdToCanvas, resolveCvdType, CVD_TYPES, CVD_VALUES, CVD_MATRICES, COLLAPSE_THRESHOLD, type CvdType, type LegendColourLint, type ColourCollapse, } from "./cvd";
|
|
31
31
|
export { loadCore, setCoreLoader, peekCore, isCoreLoaded, type CoreModule } from "./core-loader";
|
|
32
|
-
export { cornersFromCamera, readCamera, sanitizeAdoptedMap, type FrameCamera, type Corners } from "./live-frame";
|
|
32
|
+
export { cornersFromCamera, maxGeoreferenceablePitch, readCamera, sanitizeAdoptedMap, type FrameCamera, type Corners } from "./live-frame";
|
|
33
33
|
export { renderCartograph, renderCartographAtlas, MAX_CANVAS_AREA, MAX_CANVAS_DIMENSION, type RenderCartographOptions, type RenderCartographResult, type RenderAtlasOptions, type RenderAtlasResult, } from "./render";
|
|
34
34
|
export { buildPages, featureBounds, padBounds, boundsArea, atlasFields, fieldOf, parseSort, sanitizeFilename, resolveFilenames, rejectionFor, type AtlasFeature, type AtlasRejection, } from "./atlas";
|
|
35
35
|
export { createZip, type ZipFile } from "./zip";
|
|
@@ -65,6 +65,24 @@ export declare class OmFrameElement extends CartographElementBase implements Car
|
|
|
65
65
|
private updateLiveCorners;
|
|
66
66
|
private mountLive;
|
|
67
67
|
private sizeLiveMap;
|
|
68
|
+
/**
|
|
69
|
+
* Stop the adopted map tilting past what this frame can georeference.
|
|
70
|
+
*
|
|
71
|
+
* A frame without a georeference has no scale bar, no north arrow, no
|
|
72
|
+
* graticule and no export — so letting a host drive the camera past the
|
|
73
|
+
* limit produces a frame that renders an error instead of a map. The ceiling
|
|
74
|
+
* is the frame's own, recomputed whenever its box changes, because it
|
|
75
|
+
* depends on the box's aspect and the current zoom.
|
|
76
|
+
*/
|
|
77
|
+
private capMapPitch;
|
|
78
|
+
/**
|
|
79
|
+
* The ceiling follows the camera, so a zoom changes it.
|
|
80
|
+
*
|
|
81
|
+
* Bound once so add/remove pair up. Cheap enough to run on every reported
|
|
82
|
+
* view: a probe is four unprojections and the attribute is only written when
|
|
83
|
+
* the whole-degree answer actually moves.
|
|
84
|
+
*/
|
|
85
|
+
private readonly onLiveViewChanged;
|
|
68
86
|
/**
|
|
69
87
|
* Draw another frame's footprint on this one. The outline is DENSIFIED —
|
|
70
88
|
* sampled along each edge and projected point by point — because a
|
|
@@ -45,6 +45,20 @@ export declare function readCamera(el: Element): FrameCamera | null;
|
|
|
45
45
|
* a huge number that looks like a coordinate — is what lets the frame mark
|
|
46
46
|
* itself degenerate and the furniture refuse to draw.
|
|
47
47
|
*/
|
|
48
|
+
/**
|
|
49
|
+
* The steepest pitch this frame can still georeference, in whole degrees.
|
|
50
|
+
*
|
|
51
|
+
* There is no constant to use here. The corners are unprojected through the
|
|
52
|
+
* frame's OWN box, so the ceiling moves with its aspect and the zoom: a wide
|
|
53
|
+
* frame tilts further than a tall one, and zooming in raises the limit again.
|
|
54
|
+
* A fixed 45° or 60° would be wrong in both directions — too strict on the
|
|
55
|
+
* frames that could tilt, too lax on the ones that cannot.
|
|
56
|
+
*
|
|
57
|
+
* Coarse then fine: the answer only needs to be whole degrees, and each probe
|
|
58
|
+
* is four unprojections, so this is a handful of microseconds rather than
|
|
59
|
+
* something worth caching.
|
|
60
|
+
*/
|
|
61
|
+
export declare function maxGeoreferenceablePitch(core: CoreModule, camera: FrameCamera, widthPx: number, heightPx: number, ceiling?: number): number;
|
|
48
62
|
export declare function cornersFromCamera(core: CoreModule, camera: FrameCamera, widthPx: number, heightPx: number): Corners | null;
|
|
49
63
|
/** Load the core and build an `<om-map>` for a frame, from `src=` or an inline child. */
|
|
50
64
|
export declare function buildLiveMap(frame: Element): Promise<{
|