@aapicoits/powermap-web-sdk 1.0.1 → 1.1.1
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/README.md +129 -18
- package/dist/index.d.ts +420 -226
- package/dist/powermap-web-sdk.cjs.cjs +23 -23
- package/dist/powermap-web-sdk.js +1733 -1278
- package/dist/powermap-web-sdk.umd.cjs +22 -22
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,226 +1,420 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// PowerMap Web SDK — TypeScript Declaration File
|
|
3
|
-
// Auto-generated from src/index.js JSDoc
|
|
4
|
-
// ============================================================
|
|
5
|
-
|
|
6
|
-
export interface PowerMapAuthOptions {
|
|
7
|
-
clientId: string;
|
|
8
|
-
clientSecret: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface PowerMapOptions {
|
|
12
|
-
/** The HTML element ID or element reference to mount the map into */
|
|
13
|
-
container: string | HTMLElement;
|
|
14
|
-
/** Initial map center as [longitude, latitude] */
|
|
15
|
-
center?: [number, number];
|
|
16
|
-
/** Initial zoom level */
|
|
17
|
-
zoom?: number;
|
|
18
|
-
/** Minimum zoom level */
|
|
19
|
-
minZoom?: number;
|
|
20
|
-
/** Maximum zoom level */
|
|
21
|
-
maxZoom?: number;
|
|
22
|
-
/** Map style name: 'th' | 'en' | 'dark' | 'gray' or a custom style URL */
|
|
23
|
-
style?: 'th' | 'en' | 'dark' | 'gray' | string;
|
|
24
|
-
/** API Key for map tiles */
|
|
25
|
-
mapApiKey: string;
|
|
26
|
-
/** Authentication credentials for services */
|
|
27
|
-
auth: PowerMapAuthOptions;
|
|
28
|
-
/** Disable all map interactions (zoom, pan, rotate) — preview mode */
|
|
29
|
-
previewOnly?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface MarkerOptions {
|
|
33
|
-
/** [longitude, latitude] */
|
|
34
|
-
position: [number, number];
|
|
35
|
-
/** Marker type */
|
|
36
|
-
type?: 'start' | 'destination' | 'waypoint' | string;
|
|
37
|
-
/** Custom image URL */
|
|
38
|
-
iconUrl?: string;
|
|
39
|
-
/** Custom hex color for pinpoint marker (e.g. '#ff4444') */
|
|
40
|
-
color?: string;
|
|
41
|
-
/** FontAwesome icon class (e.g. 'fas fa-car') */
|
|
42
|
-
icon?: string;
|
|
43
|
-
/** Enable marker dragging */
|
|
44
|
-
draggable?: boolean;
|
|
45
|
-
/** HTML content or structured popup object */
|
|
46
|
-
popupContent?: string | { title?: string; body?: string; tag?: string; footer?: string };
|
|
47
|
-
/** Unique identifier for the marker */
|
|
48
|
-
id?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface MarkerInstance {
|
|
52
|
-
id: string;
|
|
53
|
-
position: [number, number];
|
|
54
|
-
remove(): void;
|
|
55
|
-
setLngLat(lngLat: [number, number]): this;
|
|
56
|
-
getLngLat(): { lng: number; lat: number };
|
|
57
|
-
[key: string]: unknown;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface RouteOptions {
|
|
61
|
-
start: [number, number];
|
|
62
|
-
destination: [number, number];
|
|
63
|
-
waypoints?: [number, number][];
|
|
64
|
-
optimize?: boolean;
|
|
65
|
-
[key: string]: unknown;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface RouteStep {
|
|
69
|
-
distance: number;
|
|
70
|
-
distanceStr: string;
|
|
71
|
-
duration: number;
|
|
72
|
-
durationStr: string;
|
|
73
|
-
instruction?: string;
|
|
74
|
-
[key: string]: unknown;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface RouteDetails {
|
|
78
|
-
distance: number;
|
|
79
|
-
distanceStr: string;
|
|
80
|
-
duration: number;
|
|
81
|
-
durationStr: string;
|
|
82
|
-
steps: RouteStep[];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface RouteSummary {
|
|
86
|
-
distanceStr: string;
|
|
87
|
-
durationStr: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface SearchResult {
|
|
91
|
-
id
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
1
|
+
// ============================================================
|
|
2
|
+
// PowerMap Web SDK — TypeScript Declaration File
|
|
3
|
+
// Auto-generated from src/index.js JSDoc
|
|
4
|
+
// ============================================================
|
|
5
|
+
|
|
6
|
+
export interface PowerMapAuthOptions {
|
|
7
|
+
clientId: string;
|
|
8
|
+
clientSecret: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface PowerMapOptions {
|
|
12
|
+
/** The HTML element ID or element reference to mount the map into */
|
|
13
|
+
container: string | HTMLElement;
|
|
14
|
+
/** Initial map center as [longitude, latitude] */
|
|
15
|
+
center?: [number, number];
|
|
16
|
+
/** Initial zoom level */
|
|
17
|
+
zoom?: number;
|
|
18
|
+
/** Minimum zoom level */
|
|
19
|
+
minZoom?: number;
|
|
20
|
+
/** Maximum zoom level */
|
|
21
|
+
maxZoom?: number;
|
|
22
|
+
/** Map style name: 'th' | 'en' | 'dark' | 'gray' or a custom style URL */
|
|
23
|
+
style?: 'th' | 'en' | 'dark' | 'gray' | string;
|
|
24
|
+
/** API Key for map tiles */
|
|
25
|
+
mapApiKey: string;
|
|
26
|
+
/** Authentication credentials for services */
|
|
27
|
+
auth: PowerMapAuthOptions;
|
|
28
|
+
/** Disable all map interactions (zoom, pan, rotate) — preview mode */
|
|
29
|
+
previewOnly?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface MarkerOptions {
|
|
33
|
+
/** [longitude, latitude] */
|
|
34
|
+
position: [number, number];
|
|
35
|
+
/** Marker type */
|
|
36
|
+
type?: 'start' | 'destination' | 'waypoint' | string;
|
|
37
|
+
/** Custom image URL */
|
|
38
|
+
iconUrl?: string;
|
|
39
|
+
/** Custom hex color for pinpoint marker (e.g. '#ff4444') */
|
|
40
|
+
color?: string;
|
|
41
|
+
/** FontAwesome icon class (e.g. 'fas fa-car') */
|
|
42
|
+
icon?: string;
|
|
43
|
+
/** Enable marker dragging */
|
|
44
|
+
draggable?: boolean;
|
|
45
|
+
/** HTML content or structured popup object */
|
|
46
|
+
popupContent?: string | { title?: string; body?: string; tag?: string; footer?: string };
|
|
47
|
+
/** Unique identifier for the marker */
|
|
48
|
+
id?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface MarkerInstance {
|
|
52
|
+
id: string;
|
|
53
|
+
position: [number, number];
|
|
54
|
+
remove(): void;
|
|
55
|
+
setLngLat(lngLat: [number, number]): this;
|
|
56
|
+
getLngLat(): { lng: number; lat: number };
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface RouteOptions {
|
|
61
|
+
start: [number, number];
|
|
62
|
+
destination: [number, number];
|
|
63
|
+
waypoints?: [number, number][];
|
|
64
|
+
optimize?: boolean;
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface RouteStep {
|
|
69
|
+
distance: number;
|
|
70
|
+
distanceStr: string;
|
|
71
|
+
duration: number;
|
|
72
|
+
durationStr: string;
|
|
73
|
+
instruction?: string;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface RouteDetails {
|
|
78
|
+
distance: number;
|
|
79
|
+
distanceStr: string;
|
|
80
|
+
duration: number;
|
|
81
|
+
durationStr: string;
|
|
82
|
+
steps: RouteStep[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface RouteSummary {
|
|
86
|
+
distanceStr: string;
|
|
87
|
+
durationStr: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface SearchResult {
|
|
91
|
+
id?: string;
|
|
92
|
+
gid?: string;
|
|
93
|
+
name: string;
|
|
94
|
+
nameEn?: string;
|
|
95
|
+
nameTh?: string;
|
|
96
|
+
address?: string;
|
|
97
|
+
addressEn?: string;
|
|
98
|
+
addressTh?: string;
|
|
99
|
+
position: [number, number];
|
|
100
|
+
positionLngLat?: [number, number];
|
|
101
|
+
province?: string;
|
|
102
|
+
amphoe?: string;
|
|
103
|
+
tambon?: string;
|
|
104
|
+
postCode?: string;
|
|
105
|
+
rawData?: Record<string, unknown>;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface SearchOptions {
|
|
110
|
+
location?: [number, number];
|
|
111
|
+
lang?: 'th' | 'en' | 'auto' | string;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface FlyToOptions {
|
|
116
|
+
center?: [number, number];
|
|
117
|
+
zoom?: number;
|
|
118
|
+
pitch?: number;
|
|
119
|
+
bearing?: number;
|
|
120
|
+
speed?: number;
|
|
121
|
+
curve?: number;
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface FitBoundsOptions {
|
|
126
|
+
padding?: number | { top: number; bottom: number; left: number; right: number };
|
|
127
|
+
maxZoom?: number;
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type PowerMapEventName =
|
|
132
|
+
| 'mapLoaded'
|
|
133
|
+
| 'mapClick'
|
|
134
|
+
| 'mapLongClick'
|
|
135
|
+
| 'markerClick'
|
|
136
|
+
| 'markerDrag'
|
|
137
|
+
| 'markerDragEnd'
|
|
138
|
+
| 'poiClick'
|
|
139
|
+
| 'routeCalculated'
|
|
140
|
+
| 'modeChanged'
|
|
141
|
+
| 'floorChanged'
|
|
142
|
+
| 'venueChanged'
|
|
143
|
+
| 'indoorMapLoaded'
|
|
144
|
+
| 'indoorMapUnloaded'
|
|
145
|
+
| 'error'
|
|
146
|
+
| string;
|
|
147
|
+
|
|
148
|
+
export type PowerMapMode = 'standard' | 'indoor';
|
|
149
|
+
|
|
150
|
+
export interface SetModeOptions {
|
|
151
|
+
buildingId?: string;
|
|
152
|
+
floorId?: string;
|
|
153
|
+
center?: [number, number];
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ── IMDF Types ──────────────────────────────────────────────────────────────────
|
|
158
|
+
|
|
159
|
+
/** OGC IMDF 1.0.0 Feature Types */
|
|
160
|
+
export type IMDFFeatureType =
|
|
161
|
+
| 'venue' | 'building' | 'level' | 'unit' | 'opening' | 'amenity'
|
|
162
|
+
| 'anchor' | 'footprint' | 'fixture' | 'section' | 'geofence'
|
|
163
|
+
| 'kiosk' | 'detail' | 'occupant' | 'address' | 'relationship'
|
|
164
|
+
| 'pathway';
|
|
165
|
+
|
|
166
|
+
/** SDK internal kind names */
|
|
167
|
+
export type GeometryKind =
|
|
168
|
+
| 'venue' | 'building' | 'floor' | 'unit' | 'opening' | 'amenity'
|
|
169
|
+
| 'anchor' | 'footprint' | 'fixture' | 'section' | 'geofence'
|
|
170
|
+
| 'kiosk' | 'detail' | 'occupant' | 'address' | 'relationship'
|
|
171
|
+
| 'beacon' | 'poi' | 'walkway' | 'obstacle';
|
|
172
|
+
|
|
173
|
+
/** Category visibility toggles */
|
|
174
|
+
export type CategoryType = 'poi' | 'beacon' | 'walkway' | 'obstacle';
|
|
175
|
+
|
|
176
|
+
/** IMDF LABELS object (i18n) */
|
|
177
|
+
export interface IMDFLabels {
|
|
178
|
+
[languageCode: string]: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ── Indoor Types ────────────────────────────────────────────────────────────────
|
|
182
|
+
|
|
183
|
+
export interface VenueInfo {
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
category: string;
|
|
187
|
+
floors: number[];
|
|
188
|
+
bounds: [[number, number], [number, number]] | null;
|
|
189
|
+
buildingCount: number;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface VenueListItem {
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
category: string;
|
|
196
|
+
feature: object;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface FloorInfo {
|
|
200
|
+
id: string;
|
|
201
|
+
name: string;
|
|
202
|
+
shortName: string;
|
|
203
|
+
ordinal: number;
|
|
204
|
+
outdoor: boolean;
|
|
205
|
+
unitCount: number;
|
|
206
|
+
poiCount: number;
|
|
207
|
+
beaconCount: number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface BuildingInfo {
|
|
211
|
+
id: string;
|
|
212
|
+
name: string;
|
|
213
|
+
category: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface LoadIndoorMapOptions {
|
|
217
|
+
initialFloor?: number;
|
|
218
|
+
fitBounds?: boolean;
|
|
219
|
+
fitBoundsOptions?: FitBoundsOptions;
|
|
220
|
+
animate?: boolean;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface LoadIndoorMapResult {
|
|
224
|
+
venue: object;
|
|
225
|
+
floors: number[];
|
|
226
|
+
currentFloor: number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface FloorSwitchOptions {
|
|
230
|
+
animate?: boolean;
|
|
231
|
+
duration?: number;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// ── FloorManager ────────────────────────────────────────────────────────────────
|
|
235
|
+
|
|
236
|
+
export interface FloorManager {
|
|
237
|
+
/** Set the current floor ordinal with optional animation */
|
|
238
|
+
setFloor(ordinal: number, options?: FloorSwitchOptions): Promise<FloorManager>;
|
|
239
|
+
/** Get all unique floor ordinals present in the map */
|
|
240
|
+
getAvailableFloors(): number[];
|
|
241
|
+
/** Get the current floor ordinal */
|
|
242
|
+
getCurrentFloor(): number;
|
|
243
|
+
/** Set visibility for a category of indoor objects */
|
|
244
|
+
setCategoryVisible(type: CategoryType, visible: boolean): FloorManager;
|
|
245
|
+
/** Get the currently active venue feature */
|
|
246
|
+
getActiveVenue(): object | null;
|
|
247
|
+
/** List all venue features available in loaded geometry */
|
|
248
|
+
getVenues(): VenueListItem[];
|
|
249
|
+
/** Get summary information about the currently active venue */
|
|
250
|
+
getVenueInfo(): VenueInfo | null;
|
|
251
|
+
/** Get detailed information about a specific floor */
|
|
252
|
+
getFloorInfo(ordinal: number): FloorInfo | null;
|
|
253
|
+
/** List all building features in loaded geometry */
|
|
254
|
+
getBuildings(): BuildingInfo[];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ── GeometryQuery ───────────────────────────────────────────────────────────────
|
|
258
|
+
|
|
259
|
+
export interface GeometryQuery {
|
|
260
|
+
byKind(kind: GeometryKind): GeometryQuery;
|
|
261
|
+
byFloor(ordinal: number): GeometryQuery;
|
|
262
|
+
byType(type: 'Point' | 'Polygon' | 'LineString'): GeometryQuery;
|
|
263
|
+
where(prop: string, op: 'eq' | 'neq' | 'contains' | 'gt' | 'lt' | 'exists', value?: unknown): GeometryQuery;
|
|
264
|
+
byFeatureType(featureType: IMDFFeatureType): GeometryQuery;
|
|
265
|
+
byVenueId(venueId: string): GeometryQuery;
|
|
266
|
+
byBuildingId(buildingId: string): GeometryQuery;
|
|
267
|
+
byLevelId(levelId: string): GeometryQuery;
|
|
268
|
+
toArray(): object[];
|
|
269
|
+
first(): object | null;
|
|
270
|
+
count(): number;
|
|
271
|
+
ids(): string[];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// ── Validation ──────────────────────────────────────────────────────────────────
|
|
275
|
+
|
|
276
|
+
export interface ValidationError {
|
|
277
|
+
code: string;
|
|
278
|
+
message: string;
|
|
279
|
+
featureId?: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface ValidationResult {
|
|
283
|
+
valid: boolean;
|
|
284
|
+
errors: ValidationError[];
|
|
285
|
+
warnings: ValidationError[];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ── GeometryManager ─────────────────────────────────────────────────────────────
|
|
289
|
+
|
|
290
|
+
export interface GeometryManager {
|
|
291
|
+
query(): GeometryQuery;
|
|
292
|
+
create(kind: GeometryKind, options?: object): string | null;
|
|
293
|
+
add(geojson: object): void;
|
|
294
|
+
update(id: string, patch: object): void;
|
|
295
|
+
remove(id: string): void;
|
|
296
|
+
getById(id: string): object | null;
|
|
297
|
+
getByKind(kind: GeometryKind): object[];
|
|
298
|
+
getGeoJSON(id: string, options?: { format: 'imdf' | 'standard' }): object | null;
|
|
299
|
+
export(options?: { format: 'imdf' | 'standard' }): object;
|
|
300
|
+
import(geojson: object, options?: { format: 'imdf' | 'standard' }): GeometryManager;
|
|
301
|
+
exportArchive?(): Promise<Blob>;
|
|
302
|
+
importArchive?(file: Blob | File): Promise<void>;
|
|
303
|
+
clear(): void;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// ── PowerMap Main Class ─────────────────────────────────────────────────────────
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* PowerMap SDK Main Class
|
|
310
|
+
*
|
|
311
|
+
* Provides a high-level API for map rendering, markers, routing,
|
|
312
|
+
* indoor navigation, and vehicle simulation.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* const map = new PowerMap({
|
|
316
|
+
* container: 'map',
|
|
317
|
+
* mapApiKey: 'YOUR_KEY',
|
|
318
|
+
* auth: { clientId: '...', clientSecret: '...' }
|
|
319
|
+
* })
|
|
320
|
+
* .on('mapLoaded', () => console.log('Ready!'))
|
|
321
|
+
* .setStyle('dark');
|
|
322
|
+
*/
|
|
323
|
+
export declare class PowerMap {
|
|
324
|
+
constructor(options: PowerMapOptions);
|
|
325
|
+
|
|
326
|
+
// --- Events ---
|
|
327
|
+
on(event: PowerMapEventName, callback: (...args: unknown[]) => void): this;
|
|
328
|
+
off(event: PowerMapEventName, callback: (...args: unknown[]) => void): this;
|
|
329
|
+
onMapLoaded(callback: (data: { map: PowerMap }) => void): this;
|
|
330
|
+
onClick(callback: (event: unknown) => void): this;
|
|
331
|
+
onMapLongClick(callback: (event: unknown) => void): this;
|
|
332
|
+
onMarkerClick(callback: (data: { marker: MarkerInstance; originalEvent: unknown; options: unknown }) => void): this;
|
|
333
|
+
onPoiClick(callback: (data: { feature: unknown; lngLat: unknown; point: unknown }) => void): this;
|
|
334
|
+
onMarkerDrag(callback: (data: { marker: MarkerInstance; lngLat: [number, number] }) => void): this;
|
|
335
|
+
onMarkerDragEnd(callback: (data: { marker: MarkerInstance; lngLat: [number, number] }) => void): this;
|
|
336
|
+
onRouteCalculated(callback: (route: unknown) => void): this;
|
|
337
|
+
onError(callback: (error: Error) => void): this;
|
|
338
|
+
|
|
339
|
+
// --- Map Style & Mode ---
|
|
340
|
+
setStyle(name: 'th' | 'en' | 'dark' | 'gray' | string): this;
|
|
341
|
+
setMode(mode: PowerMapMode, options?: SetModeOptions): this;
|
|
342
|
+
|
|
343
|
+
// --- Controls ---
|
|
344
|
+
setNavigationControl(options: boolean | object): this;
|
|
345
|
+
setFullscreenControl(options: boolean | object): this;
|
|
346
|
+
|
|
347
|
+
// --- Camera ---
|
|
348
|
+
flyTo(options: FlyToOptions): this;
|
|
349
|
+
easeTo(options: FlyToOptions): this;
|
|
350
|
+
fitBounds(bounds: [[number, number], [number, number]], options?: FitBoundsOptions): this;
|
|
351
|
+
jumpTo(options: FlyToOptions): this;
|
|
352
|
+
setPitch(pitch: number, animate?: boolean): this;
|
|
353
|
+
setBearing(bearing: number, animate?: boolean): this;
|
|
354
|
+
zoomIn(): this;
|
|
355
|
+
zoomOut(): this;
|
|
356
|
+
rotateLeft(): this;
|
|
357
|
+
rotateRight(): this;
|
|
358
|
+
getCenter(): { lng: number; lat: number };
|
|
359
|
+
getZoom(): number;
|
|
360
|
+
getPitch(): number;
|
|
361
|
+
getBearing(): number;
|
|
362
|
+
|
|
363
|
+
// --- Markers ---
|
|
364
|
+
addMarker(options: MarkerOptions): MarkerInstance;
|
|
365
|
+
getMarker(id: string): MarkerInstance | null;
|
|
366
|
+
removeMarker(markerOrId: MarkerInstance | string): this;
|
|
367
|
+
updatePopup(marker: MarkerInstance, content: string | object): this;
|
|
368
|
+
clearMarkers(): this;
|
|
369
|
+
|
|
370
|
+
// --- Routing ---
|
|
371
|
+
addRoute(options: RouteOptions): Promise<unknown>;
|
|
372
|
+
clearRoutes(): this;
|
|
373
|
+
getRouteDetails(): RouteDetails | null;
|
|
374
|
+
getRouteSummary(): RouteSummary | null;
|
|
375
|
+
formatDistance(meters: number): string;
|
|
376
|
+
formatDuration(seconds: number): string;
|
|
377
|
+
|
|
378
|
+
// --- Search ---
|
|
379
|
+
search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
|
|
380
|
+
|
|
381
|
+
// --- Layers ---
|
|
382
|
+
showLayer(layerId: string): Promise<this>;
|
|
383
|
+
hideLayer(layerId: string): this;
|
|
384
|
+
toggleLayer(layerId: string): Promise<this>;
|
|
385
|
+
|
|
386
|
+
// --- Indoor Venue Selection ---
|
|
387
|
+
/** Select and activate an indoor venue from already-loaded geometry data */
|
|
388
|
+
loadIndoorMap(venueId: string, options?: LoadIndoorMapOptions): LoadIndoorMapResult;
|
|
389
|
+
/** Convenience alias for map.indoor.setFloor() */
|
|
390
|
+
setFloor(level: number, options?: FloorSwitchOptions): this;
|
|
391
|
+
/** Exit indoor mode and clear the active venue selection */
|
|
392
|
+
unloadIndoorMap(): this;
|
|
393
|
+
|
|
394
|
+
// --- Managers (advanced access) ---
|
|
395
|
+
readonly layers: unknown;
|
|
396
|
+
readonly geometry: GeometryManager;
|
|
397
|
+
readonly indoor: FloorManager;
|
|
398
|
+
readonly editor: unknown;
|
|
399
|
+
debug(): unknown;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// ── IMDF Utilities ──────────────────────────────────────────────────────────────
|
|
403
|
+
|
|
404
|
+
export declare class IMDFConverter {
|
|
405
|
+
static MAPPING: Record<GeometryKind, { feature_type: string; category: string }>;
|
|
406
|
+
static IMDF_CATEGORIES: Record<string, string[]>;
|
|
407
|
+
static REQUIRED_PROPERTIES: Record<string, string[]>;
|
|
408
|
+
static toIMDF(featureCollection: object): object;
|
|
409
|
+
static fromIMDF(imdfCollection: object): object;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export declare class IMDFArchive {
|
|
413
|
+
static toArchive(featureCollection: object, options?: { JSZip?: unknown }): Promise<Blob>;
|
|
414
|
+
static fromArchive(archiveData: Blob | File | ArrayBuffer, options?: { JSZip?: unknown }): Promise<object>;
|
|
415
|
+
static generateManifest(featureCollection: object): object;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export declare class IMDFValidator {
|
|
419
|
+
static validate(featureCollection: object, options?: { strict?: boolean }): ValidationResult;
|
|
420
|
+
}
|