@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,7 @@
|
|
|
1
|
+
import type { OEMFloor, OEMRegion } from '@opendfieldmap/core';
|
|
2
|
+
export interface OEMTileLookup {
|
|
3
|
+
covered: boolean;
|
|
4
|
+
version?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const lookupOEMTile: (coverage: OEMRegion["coverage"], floor: OEMFloor, zoom: number, x: number, y: number) => OEMTileLookup;
|
|
7
|
+
export declare const appendOEMTileVersion: (url: string, version?: string) => string;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { OEMManifest, OEMPointFilter, OEMPosition, OEMResources, OEMView } from '@opendfieldmap/core';
|
|
2
|
+
/** Optional static layers controlled independently by the host. */
|
|
3
|
+
export interface OEMFeatures {
|
|
4
|
+
points?: boolean;
|
|
5
|
+
labels?: boolean;
|
|
6
|
+
boundaries?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Low-level rendering options used by the public Widget package. */
|
|
9
|
+
export interface OEMOptions {
|
|
10
|
+
resources: OEMResources;
|
|
11
|
+
manifest?: OEMManifest;
|
|
12
|
+
regionId?: string;
|
|
13
|
+
floorId?: string;
|
|
14
|
+
locale?: string;
|
|
15
|
+
theme?: 'light' | 'dark';
|
|
16
|
+
view?: OEMView;
|
|
17
|
+
features?: OEMFeatures;
|
|
18
|
+
pointFilter?: OEMPointFilter;
|
|
19
|
+
/** Groups nearby markers by point type. Defaults to true. */
|
|
20
|
+
markerClustering?: boolean;
|
|
21
|
+
/** Prevents user drag and trackpad-pan gestures without blocking programmatic view changes. */
|
|
22
|
+
lockDrag?: boolean;
|
|
23
|
+
/** Prevents user zoom gestures without blocking programmatic view changes. */
|
|
24
|
+
lockZoom?: boolean;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
onError?: (error: Error) => void;
|
|
27
|
+
}
|
|
28
|
+
/** Lifecycle events emitted by a low-level OEM map instance. */
|
|
29
|
+
export interface OEMEvents {
|
|
30
|
+
viewchange: OEMView;
|
|
31
|
+
regionchange: {
|
|
32
|
+
regionId: string;
|
|
33
|
+
};
|
|
34
|
+
floorchange: {
|
|
35
|
+
floorId: string;
|
|
36
|
+
};
|
|
37
|
+
loading: {
|
|
38
|
+
feature: 'points' | 'labels' | 'boundaries';
|
|
39
|
+
loading: boolean;
|
|
40
|
+
};
|
|
41
|
+
load: {
|
|
42
|
+
regionId: string;
|
|
43
|
+
floorId: string;
|
|
44
|
+
};
|
|
45
|
+
error: Error;
|
|
46
|
+
}
|
|
47
|
+
/** Controls whether a programmatic zoom uses Leaflet's native transition. */
|
|
48
|
+
export interface OEMZoomOptions {
|
|
49
|
+
animate?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The framework-agnostic OEM rendering kernel.
|
|
53
|
+
*
|
|
54
|
+
* The embeddable Widget exposes a smaller surface and does not pass through
|
|
55
|
+
* Leaflet or map-layer objects.
|
|
56
|
+
*/
|
|
57
|
+
export interface OEM {
|
|
58
|
+
readonly manifest: OEMManifest;
|
|
59
|
+
readonly destroyed: boolean;
|
|
60
|
+
getView(): OEMView;
|
|
61
|
+
setView(view: OEMView): void;
|
|
62
|
+
setZoom(zoom: number, options?: OEMZoomOptions): void;
|
|
63
|
+
fitBounds(bounds: [OEMPosition, OEMPosition]): void;
|
|
64
|
+
setRegion(regionId: string): Promise<void>;
|
|
65
|
+
setFloor(floorId: string): void;
|
|
66
|
+
setLocale(locale: string): Promise<void>;
|
|
67
|
+
getLocale(): {
|
|
68
|
+
requested: string;
|
|
69
|
+
resolved: string;
|
|
70
|
+
};
|
|
71
|
+
setTheme(theme: 'light' | 'dark'): void;
|
|
72
|
+
setFeatures(features: OEMFeatures): Promise<void>;
|
|
73
|
+
setPointFilter(filter: OEMPointFilter): void;
|
|
74
|
+
setMarkerClustering(enabled: boolean): void;
|
|
75
|
+
resize(): void;
|
|
76
|
+
on<Event extends keyof OEMEvents>(event: Event, handler: (payload: OEMEvents[Event]) => void): () => void;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opendfieldmap/map",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Rendering kernel for Open Endfield Map widgets",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./style.css": "./dist/style.css"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"leaflet": "1.9.4",
|
|
23
|
+
"leaflet.markercluster": "1.5.3",
|
|
24
|
+
"trackpad-input": "0.1.1",
|
|
25
|
+
"@opendfieldmap/core": "^0.1.0-alpha.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/leaflet": "1.9.16",
|
|
29
|
+
"@types/leaflet.markercluster": "1.5.6"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|