@opendfieldmap/map 0.1.0-alpha.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/LICENSE +661 -0
- package/dist/assets/map-pattern.svg +19 -0
- package/dist/assets/marker-hover.webp +0 -0
- package/dist/assets/marker-select.webp +0 -0
- package/dist/atlos/mapOverdrag.d.ts +3 -0
- package/dist/atlos/smoothTileLayer.d.ts +10 -0
- package/dist/atlos/smoothWheelZoom.d.ts +61 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +7 -0
- package/dist/runtime-ROM65Z24.js +1027 -0
- package/dist/runtime-ROM65Z24.js.map +7 -0
- package/dist/runtime.d.ts +104 -0
- package/dist/style.css +1339 -0
- package/dist/tileVersion.d.ts +7 -0
- package/dist/types.d.ts +78 -0
- package/package.json +34 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="141" height="141" viewBox="0 0 141 141" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2186_881)">
|
|
3
|
+
<path d="M3.31 0H0V3.31H3.31V0Z" fill="#333333"/>
|
|
4
|
+
<path d="M3.31 140.48H0V143.79H3.31V140.48Z" fill="#333333"/>
|
|
5
|
+
<path d="M141.57 140.48V141.64H140.41V142.64H142.57V140.48H141.57ZM1.08002 1.15002V3.31002H2.08002V2.15002H3.23002V1.15002H1.08002ZM5.23002 1.15002V2.15002H138.41V1.15002H5.23002ZM5.23002 141.64V142.64H138.41V141.64H5.23002ZM2.08002 140.48H1.08002V142.64H3.23002V141.64H2.08002V140.48ZM2.08002 5.31002H1.08002V138.48H2.08002V5.31002ZM140.41 1.15002V2.15002H141.57V3.31002H142.57V1.15002H140.41ZM141.57 5.31002V138.48H142.57V5.31002H141.57Z" fill="#333333"/>
|
|
6
|
+
<path d="M136.992 6.00987L126.272 16.7296L126.979 17.4367L137.699 6.71698L136.992 6.00987Z" fill="#333333"/>
|
|
7
|
+
<path d="M6.65291 6.01604L5.9458 6.72314L16.6655 17.4429L17.3726 16.7358L6.65291 6.01604Z" fill="#333333"/>
|
|
8
|
+
<path d="M16.6617 126.342L5.94196 137.062L6.64906 137.769L17.3688 127.049L16.6617 126.342Z" fill="#333333"/>
|
|
9
|
+
<path d="M126.985 126.346L126.278 127.053L136.998 137.773L137.705 137.066L126.985 126.346Z" fill="#333333"/>
|
|
10
|
+
<path d="M116.37 116.09L116.02 116.45L119.56 119.98L119.91 119.63L116.37 116.09ZM111.37 111.09L111.02 111.45L114.56 114.98L114.91 114.63L111.37 111.09ZM106.37 106.09L106.02 106.45L109.56 109.98L109.91 109.63L106.37 106.09ZM101.37 101.09L101.02 101.45L104.56 104.98L104.91 104.63L101.37 101.09ZM96.37 96.1501L96.02 96.5L99.56 100.03L99.91 99.6801L96.37 96.1501ZM91.42 91.1501L91.07 91.5L94.61 95.03L94.96 94.6801L91.42 91.1501ZM86.42 86.2L86.07 86.55L89.61 90.08L89.96 89.7301L86.42 86.2ZM81.48 81.2L81.12 81.5501L84.66 85.09L85.01 84.7301L81.48 81.2ZM76.48 76.2L76.12 76.5501L80 80.39L80.35 80.03L76.48 76.2ZM73.48 73.2L72.17 71.9001L71.83 71.5501L71.48 71.9001L71.83 72.25L75 75.4401L75.35 75.0801L73.48 73.2ZM66.88 66.6L66.52 66.95L69.84 70.27L70.06 70.49L70.41 70.13L66.88 66.6ZM61.93 61.6501L61.57 62L65.11 65.5401L65.46 65.18L61.93 61.6501ZM57 56.7001L56.64 57.05L60.18 60.59L60.53 60.23L57 56.7001ZM52.05 51.7001L51.69 52.05L55.23 55.59L55.58 55.23L52.05 51.7001ZM47.05 46.7001L46.69 47.05L50.23 50.59L50.58 50.23L47.05 46.7001ZM42.1 41.75L41.74 42.1L45.28 45.64L45.63 45.28L42.1 41.75ZM37.1 36.75L36.74 37.1L40.28 40.64L40.63 40.28L37.1 36.75ZM32.1 31.8L31.74 32.1501L35.28 35.69L35.63 35.3301L32.1 31.8ZM27.28 27L26.92 27.35L30.46 30.89L30.81 30.5301L27.28 27ZM22.28 22.05L22 22.4L25.54 25.9401L25.89 25.58L22.28 22.05Z" fill="#333333"/>
|
|
11
|
+
<path d="M27.27 116.09L23.73 119.63L24.09 119.98L27.62 116.45L27.27 116.09ZM32.22 111.09L28.68 114.63L29 115L32.53 111.47L32.22 111.09ZM37.22 106.15L33.68 109.68L34.04 110.03L37.57 106.5L37.22 106.15ZM42.17 101.15L38.63 104.68L38.99 105.03L42.52 101.5L42.17 101.15ZM47.17 96.1501L43.63 99.6801L43.99 100.03L47.52 96.5L47.17 96.1501ZM52.17 91.1501L48.63 94.6801L48.99 95.03L52.52 91.5L52.17 91.1501ZM57 86.4001L53.46 89.9301L53.82 90.28L57.35 86.75L57 86.4001ZM62 81.4001L58.38 85L58.74 85.3601L62.27 81.82L62 81.4001ZM67 76.4001L63.33 80L63.69 80.3601L67.22 76.82L67 76.4001ZM71.95 71.4001L71.6 71.75L69.97 73.3701L68.41 74.93L68.77 75.2901L70.33 73.7301L71.95 72.1L72.3 71.75L71.95 71.4001ZM76.95 66.4001L73.63 69.71L73.41 69.93L73.76 70.2901L73.99 70.06L77.12 67L76.95 66.4001ZM81.95 61.4501L78.41 64.9801L78.76 65.34L82.07 62L81.95 61.4501ZM86.95 56.5L83.41 60.03L83.76 60.39L87 57.05L86.95 56.5ZM91.95 51.5L88.41 55.03L88.76 55.39L92 52.1L91.95 51.5ZM96.9 46.5L93 50.3301L93.35 50.69L96.89 47.1501L96.9 46.5ZM101.9 41.55L98 45.3801L98.35 45.7401L101.89 42.2001L101.9 41.55ZM106.9 36.55L103.36 40.0801L103.71 40.44L107.25 36.9001L106.9 36.55ZM111.9 31.6L108.36 35.1301L108.71 35.4901L112.25 31.9501L111.9 31.6ZM116.36 27L112.83 30.5301L113.18 30.89L116.72 27.35L116.36 27ZM121.36 22.05L117.83 25.58L118.18 25.9401L121.72 22.4L121.36 22.05Z" fill="#333333"/>
|
|
12
|
+
<path d="M73.81 69.91H69.84V73.88H73.81V69.91Z" fill="#333333"/>
|
|
13
|
+
</g>
|
|
14
|
+
<defs>
|
|
15
|
+
<clipPath id="clip0_2186_881">
|
|
16
|
+
<rect width="140.41" height="140.48" fill="white"/>
|
|
17
|
+
</clipPath>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import L from 'leaflet';
|
|
2
|
+
interface TileLevel {
|
|
3
|
+
el: HTMLElement;
|
|
4
|
+
origin: L.Point;
|
|
5
|
+
zoom: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class SmoothTileLayer extends L.TileLayer {
|
|
8
|
+
_setZoomTransform(level: TileLevel, center: L.LatLng, zoom: number): void;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import L from 'leaflet';
|
|
2
|
+
export interface SmoothWheelZoomOptions {
|
|
3
|
+
/** Enables inertial continuation after wheel zoom input. */
|
|
4
|
+
enableInertia?: boolean;
|
|
5
|
+
/** Enables trackpad gestures classified as map panning. */
|
|
6
|
+
panEnabled?: boolean;
|
|
7
|
+
/** Enables wheel and trackpad gestures classified as map zooming. */
|
|
8
|
+
zoomEnabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class SmoothWheelZoom {
|
|
11
|
+
private readonly map;
|
|
12
|
+
private readonly container;
|
|
13
|
+
private readonly inertiaEnabled;
|
|
14
|
+
private readonly panEnabled;
|
|
15
|
+
private readonly zoomEnabled;
|
|
16
|
+
private readonly wheelInputRouter;
|
|
17
|
+
private zoomFrame;
|
|
18
|
+
private panFrame;
|
|
19
|
+
private endTimer;
|
|
20
|
+
private panTailTimer;
|
|
21
|
+
private targetZoom;
|
|
22
|
+
private anchorPoint;
|
|
23
|
+
private anchorLatLng;
|
|
24
|
+
private zoomVelocity;
|
|
25
|
+
private lastZoomInputTime;
|
|
26
|
+
private inertiaStep;
|
|
27
|
+
private lastFrameTime;
|
|
28
|
+
private pendingPanOffset;
|
|
29
|
+
private panRawCenterPoint;
|
|
30
|
+
private gestureMode;
|
|
31
|
+
private gestureActive;
|
|
32
|
+
private trackpadDragging;
|
|
33
|
+
private overdragSettling;
|
|
34
|
+
private disposed;
|
|
35
|
+
constructor(map: L.Map, options?: SmoothWheelZoomOptions);
|
|
36
|
+
dispose: () => void;
|
|
37
|
+
private handleWheel;
|
|
38
|
+
private handleRoutedWheel;
|
|
39
|
+
private routeWheelEvent;
|
|
40
|
+
private handleZoom;
|
|
41
|
+
private handleTrackpadPan;
|
|
42
|
+
private startGesture;
|
|
43
|
+
private updateAnchor;
|
|
44
|
+
private continuousContainerPointToLatLng;
|
|
45
|
+
private updateZoomVelocity;
|
|
46
|
+
private applyZoomFrame;
|
|
47
|
+
private applyPanFrame;
|
|
48
|
+
private applyConstrainedPan;
|
|
49
|
+
private resistOverdrag;
|
|
50
|
+
private beginOverdragSettlement;
|
|
51
|
+
private schedulePanTailRelease;
|
|
52
|
+
private clearOverdragSettlement;
|
|
53
|
+
private moveToZoom;
|
|
54
|
+
private scheduleGestureEnd;
|
|
55
|
+
private handleGestureEnd;
|
|
56
|
+
private finishGesture;
|
|
57
|
+
private finishLeafletZoomAnimation;
|
|
58
|
+
private resetVisualState;
|
|
59
|
+
private clearScheduledWork;
|
|
60
|
+
}
|
|
61
|
+
export declare const enableSmoothWheelZoom: (map: L.Map, options?: SmoothWheelZoomOptions) => SmoothWheelZoom;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// packages/map/src/index.ts
|
|
2
|
+
import { loadOEMManifest, validateOEMManifest } from "@opendfieldmap/core";
|
|
3
|
+
async function createOEM(container, options) {
|
|
4
|
+
if (typeof document === "undefined") throw new Error("createOEM must run in a browser");
|
|
5
|
+
options.signal?.throwIfAborted();
|
|
6
|
+
const element = typeof container === "string" ? document.querySelector(container) : container;
|
|
7
|
+
if (!element) throw new Error(`OEM container not found: ${container}`);
|
|
8
|
+
const manifest = options.manifest ? validateOEMManifest(options.manifest) : await loadOEMManifest(options.resources, options.signal);
|
|
9
|
+
const { OEM: OEMClass } = await import("./runtime-ROM65Z24.js");
|
|
10
|
+
options.signal?.throwIfAborted();
|
|
11
|
+
const instance = new OEMClass(element, manifest, options);
|
|
12
|
+
try {
|
|
13
|
+
await instance.setFeatures(options.features ?? {});
|
|
14
|
+
options.signal?.throwIfAborted();
|
|
15
|
+
return instance;
|
|
16
|
+
} catch (error) {
|
|
17
|
+
instance.destroy();
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
createOEM
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { loadOEMManifest, validateOEMManifest } from '@opendfieldmap/core';\nimport type { OEM, OEMOptions } from './types';\nexport type * from './types';\n\n/** Creates the framework-agnostic OEM rendering kernel in a browser. */\nexport async function createOEM(container: string | HTMLElement, options: OEMOptions): Promise<OEM> {\n if (typeof document === 'undefined') throw new Error('createOEM must run in a browser');\n options.signal?.throwIfAborted();\n const element = typeof container === 'string' ? document.querySelector<HTMLElement>(container) : container;\n if (!element) throw new Error(`OEM container not found: ${container}`);\n const manifest = options.manifest ? validateOEMManifest(options.manifest) : await loadOEMManifest(options.resources, options.signal);\n const { OEM: OEMClass } = await import('./runtime');\n options.signal?.throwIfAborted();\n const instance = new OEMClass(element, manifest, options);\n try {\n await instance.setFeatures(options.features ?? {});\n options.signal?.throwIfAborted();\n return instance;\n } catch (error) {\n instance.destroy();\n throw error;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,iBAAiB,2BAA2B;AAKrD,eAAsB,UAAU,WAAiC,SAAmC;AAClG,MAAI,OAAO,aAAa,YAAa,OAAM,IAAI,MAAM,iCAAiC;AACtF,UAAQ,QAAQ,eAAe;AAC/B,QAAM,UAAU,OAAO,cAAc,WAAW,SAAS,cAA2B,SAAS,IAAI;AACjG,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,4BAA4B,SAAS,EAAE;AACrE,QAAM,WAAW,QAAQ,WAAW,oBAAoB,QAAQ,QAAQ,IAAI,MAAM,gBAAgB,QAAQ,WAAW,QAAQ,MAAM;AACnI,QAAM,EAAE,KAAK,SAAS,IAAI,MAAM,OAAO,uBAAW;AAClD,UAAQ,QAAQ,eAAe;AAC/B,QAAM,WAAW,IAAI,SAAS,SAAS,UAAU,OAAO;AACxD,MAAI;AACF,UAAM,SAAS,YAAY,QAAQ,YAAY,CAAC,CAAC;AACjD,YAAQ,QAAQ,eAAe;AAC/B,WAAO;AAAA,EACT,SAAS,OAAO;AACd,aAAS,QAAQ;AACjB,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|