@nika-js/onlymap 0.8.1 → 0.8.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 +19 -0
- package/dist/{LercDecode.es-DKhLh4TO.js → LercDecode.es-DW-G7u1_.js} +1 -1
- package/dist/{basemap-BjXMRr_M.js → basemap-C6mTd_uL.js} +784 -780
- package/dist/basemap.d.ts +2 -0
- package/dist/cartograph/elements/om-frame.d.ts +12 -1
- package/dist/cartograph/georef.d.ts +11 -1
- package/dist/cartograph/graticule.d.ts +1 -1
- package/dist/cartograph/live-frame.d.ts +17 -18
- package/dist/cartograph.js +805 -772
- package/dist/cartograph.standalone.js +1560 -1527
- package/dist/elements/om-map.d.ts +2 -0
- package/dist/{geoparquet-D9pYDrCk.js → geoparquet-CMESy27r.js} +1 -1
- package/dist/{index-BdKNZcs-.js → index-BfL5W1Ay.js} +1 -1
- package/dist/{index-BGQidVp5.js → index-CgpoaR-U.js} +1 -1
- package/dist/{index-CqtubBZ4.js → index-CrMM0kHK.js} +1 -1
- package/dist/{index-D6R4z3Zs.js → index-DgHzTg2n.js} +794 -763
- package/dist/{index-Zm8MxpvR.js → index-FEPpi86V.js} +2 -2
- package/dist/{lerc-BdHcL8pi.js → lerc-BQFrOj7h.js} +2 -2
- package/dist/onlymap.standalone.js +1445 -1410
- package/dist/onlymapjs.js +1 -1
- package/dist/{raster-B7rPpOTP.js → raster-6vW4_NSI.js} +3 -3
- package/dist/{raster-pipeline-X2-mnFQx.js → raster-pipeline-CYiGgsil.js} +1 -1
- package/dist/runtime-core.d.ts +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BF-buFRB.js → zarr-BNQZpB1t.js} +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +4 -0
- package/package.json +3 -3
- package/skills/onlymapjs/references/syntax.md +1 -1
package/dist/basemap.d.ts
CHANGED
|
@@ -162,6 +162,8 @@ export declare class MapLibreBasemapAdapter {
|
|
|
162
162
|
* back, while a controller maximum simply refuses to go further.
|
|
163
163
|
*/
|
|
164
164
|
setMaxPitch(maxPitch: number | null): void;
|
|
165
|
+
/** Floor how far the user can zoom out. Null restores MapLibre's own minimum. */
|
|
166
|
+
setMinZoom(minZoom: number | null): void;
|
|
165
167
|
isLoaded(): boolean;
|
|
166
168
|
getViewport(): ViewportLike;
|
|
167
169
|
getViewState(): BasemapViewState;
|
|
@@ -33,6 +33,8 @@ export declare class OmFrameElement extends CartographElementBase implements Car
|
|
|
33
33
|
private liveMapOwned;
|
|
34
34
|
/** A capture standing in for the live map during export/print. */
|
|
35
35
|
private captureImage;
|
|
36
|
+
/** The authored camera last driven into the map, so a re-render can tell an edit from a repaint. */
|
|
37
|
+
private appliedCameraKey;
|
|
36
38
|
private printing;
|
|
37
39
|
get mode(): FrameMode;
|
|
38
40
|
/** The mounted `<om-map>`, once a live frame has one. */
|
|
@@ -62,6 +64,16 @@ export declare class OmFrameElement extends CartographElementBase implements Car
|
|
|
62
64
|
/** Leave live mode without deleting an authored inline map. */
|
|
63
65
|
private suspendLiveMode;
|
|
64
66
|
private releaseLiveMap;
|
|
67
|
+
/** The mounted map's own camera, or null before it can report one. */
|
|
68
|
+
private liveCamera;
|
|
69
|
+
/**
|
|
70
|
+
* The map settled somewhere new. Re-derive the georeference from where it
|
|
71
|
+
* actually is, and tell the page — its north arrow, scale bar, graticule,
|
|
72
|
+
* locator inset and {{scale}} tokens all describe THIS view now. A frozen
|
|
73
|
+
* frame captures these corners too, so a freeze after a rotate places the
|
|
74
|
+
* raster by the view that was captured, not the one that was authored.
|
|
75
|
+
*/
|
|
76
|
+
private readonly onLiveViewSettled;
|
|
65
77
|
private updateLiveCorners;
|
|
66
78
|
private mountLive;
|
|
67
79
|
private sizeLiveMap;
|
|
@@ -74,7 +86,6 @@ export declare class OmFrameElement extends CartographElementBase implements Car
|
|
|
74
86
|
* is the frame's own, recomputed whenever its box changes, because it
|
|
75
87
|
* depends on the box's aspect and the current zoom.
|
|
76
88
|
*/
|
|
77
|
-
private capMapPitch;
|
|
78
89
|
/**
|
|
79
90
|
* Draw another frame's footprint on this one. The outline is DENSIFIED —
|
|
80
91
|
* sampled along each edge and projected point by point — because a
|
|
@@ -84,16 +84,26 @@ export interface FrameGeoref {
|
|
|
84
84
|
/** Millimetres from the frame's top-left → lon/lat. Null when unmappable. */
|
|
85
85
|
unproject(xMm: number, yMm: number): LngLat | null;
|
|
86
86
|
/** Ground metres per page millimetre along the frame's horizontal centre line. */
|
|
87
|
+
/**
|
|
88
|
+
* Corners and queries are taken as continuous longitudes (a live frame's,
|
|
89
|
+
* from the renderer) rather than folded into one turn of the world.
|
|
90
|
+
*/
|
|
91
|
+
readonly continuous: boolean;
|
|
87
92
|
groundMetersPerMm(): number;
|
|
93
|
+
/** Ground length of one row of the frame, walked in segments so a world-wrapping row measures true. */
|
|
94
|
+
rowGroundMeters(yMm: number, segments?: number): number | null;
|
|
88
95
|
}
|
|
96
|
+
export declare const wrapLng: (lng: number) => number;
|
|
89
97
|
export interface CreateGeorefOptions {
|
|
90
98
|
corners: readonly [LngLat, LngLat, LngLat, LngLat];
|
|
91
99
|
widthMm: number;
|
|
92
100
|
heightMm: number;
|
|
93
101
|
/** Resolved CRS plane; defaults to Web Mercator (what live frames always are). */
|
|
94
102
|
crsForward?: CrsForward | null;
|
|
103
|
+
/** Trust the corners' longitudes as continuous; see `FrameGeoref.continuous`. */
|
|
104
|
+
continuous?: boolean;
|
|
95
105
|
}
|
|
96
|
-
export declare function createFrameGeoref({ corners, widthMm, heightMm, crsForward }: CreateGeorefOptions): FrameGeoref;
|
|
106
|
+
export declare function createFrameGeoref({ corners, widthMm, heightMm, crsForward, continuous }: CreateGeorefOptions): FrameGeoref;
|
|
97
107
|
/**
|
|
98
108
|
* Parse a `corners=` attribute: JSON `[[lng,lat],[lng,lat],[lng,lat],[lng,lat]]`
|
|
99
109
|
* (tl, tr, br, bl) or a flat list of eight numbers in the same order. Returns
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* visibly bow away from the truth on a wide or rotated frame.
|
|
14
14
|
*/
|
|
15
15
|
import type { LngLat } from "../geodesy";
|
|
16
|
-
import type
|
|
16
|
+
import { type FrameGeoref } from "./georef";
|
|
17
17
|
export interface GraticuleLine {
|
|
18
18
|
/** Points in frame millimetres. */
|
|
19
19
|
points: {
|
|
@@ -36,29 +36,28 @@ export interface FrameCamera {
|
|
|
36
36
|
/** Read the frame's own camera; null when it has not authored one. */
|
|
37
37
|
export declare function readCamera(el: Element): FrameCamera | null;
|
|
38
38
|
/**
|
|
39
|
-
* The
|
|
40
|
-
* tl, tr, br, bl order.
|
|
39
|
+
* The steepest pitch this frame can still georeference, in whole degrees.
|
|
41
40
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
41
|
+
* Since 0.8.3 a live frame's georeference is continuous — it follows the
|
|
42
|
+
* world's wrap and the blank ground past the Mercator band the way the map
|
|
43
|
+
* does — so for any real box this is simply the ceiling: at deck's own 60°
|
|
44
|
+
* and field of view no corner ever loses its finite answer. Kept as the
|
|
45
|
+
* honest way to ask the question (and for a degenerate box, where the answer
|
|
46
|
+
* is 0), not because a frame constrains its map with it any more.
|
|
47
47
|
*/
|
|
48
|
+
export declare function maxGeoreferenceablePitch(core: CoreModule, camera: FrameCamera, widthPx: number, heightPx: number, ceiling?: number): number;
|
|
48
49
|
/**
|
|
49
|
-
* The
|
|
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.
|
|
50
|
+
* The four ground corners a camera sees in a `widthPx × heightPx` box, in
|
|
51
|
+
* tl, tr, br, bl order — CONTINUOUS longitudes, as the renderer reports them.
|
|
56
52
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
53
|
+
* Not folded into one turn of the world and not clamped to the Mercator band:
|
|
54
|
+
* a frame zoomed out far enough shows the world wrapping, exactly as the map
|
|
55
|
+
* inside it does, and its corners say so (a corner can read −360°, or 88°).
|
|
56
|
+
* The georeference fitted from them is `continuous`, so furniture places
|
|
57
|
+
* every copy where the renderer draws it. Null only when a corner has no
|
|
58
|
+
* finite answer at all — which, at deck's own 60° pitch ceiling and field of
|
|
59
|
+
* view, no camera produces; it guards a degenerate box, not a steep one.
|
|
60
60
|
*/
|
|
61
|
-
export declare function maxGeoreferenceablePitch(core: CoreModule, camera: FrameCamera, widthPx: number, heightPx: number, ceiling?: number): number;
|
|
62
61
|
export declare function cornersFromCamera(core: CoreModule, camera: FrameCamera, widthPx: number, heightPx: number): Corners | null;
|
|
63
62
|
/** Load the core and build an `<om-map>` for a frame, from `src=` or an inline child. */
|
|
64
63
|
export declare function buildLiveMap(frame: Element): Promise<{
|