@mapxus/mapxus-map-jp 6.0.0 → 7.1.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.
Files changed (4) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +867 -511
  3. package/index.js +3 -3
  4. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  // Generated by dts-bundle-generator v6.13.0
2
2
 
3
3
  import { AxiosPromise } from 'axios';
4
- import { Feature, FeatureCollection, GeometryObject, LineString, Polygon } from 'geojson';
5
- import { Event, IControl, Map as MaplibreMap, Map as maplibreMap, MapGeoJSONFeature, MapMouseEvent, PointLike } from 'maplibre-gl';
4
+ import { ControlPosition, FilterSpecification, GeoJSONFeature, IControl, LngLat, Map as MaplibreMap, Map as maplibreMap, MapGeoJSONFeature, MapLayerEventType, PointLike } from 'maplibre-gl';
6
5
 
7
- declare enum ThemeType {
6
+ export declare enum ThemeType {
8
7
  CHRISTMAS = "christmas",
9
8
  HALLOWEEN = "halloween",
10
9
  MAPPY_BEE = "mappyBee",
@@ -13,18 +12,44 @@ declare enum ThemeType {
13
12
  COMMON = "common",
14
13
  MAPXUS_V2 = "mapxus_v2"
15
14
  }
15
+ export interface ISelectedBuildingBorderStyle {
16
+ lineWidth?: number;
17
+ lineColor?: string;
18
+ lineOpacity?: number;
19
+ }
20
+ export interface IFloorsControlStyle {
21
+ fontColor?: string;
22
+ activeFontColor?: string;
23
+ backgroundColor?: string;
24
+ activeBackgroundColor?: string;
25
+ itemSize?: number;
26
+ itemCount?: number;
27
+ defaultFolded?: boolean;
28
+ }
29
+ export declare enum FloorSwitchMode {
30
+ SWITCHED_BY_BUILDING = 0,
31
+ SWITCHED_BY_VENUE = 1
32
+ }
16
33
  export interface IMapOption {
17
- map: maplibregl.Map;
34
+ map: MaplibreMap;
18
35
  appId: string;
19
36
  secret: string;
20
37
  enableFloorControl?: boolean;
21
38
  enableBuildingSelector?: boolean;
39
+ venueId?: string;
22
40
  buildingId?: string;
41
+ floorId?: string;
42
+ /**
43
+ * @deprecated "floor" is deprecated, please use "floorId" instead
44
+ */
23
45
  floor?: string;
24
46
  poiId?: string;
25
47
  hiddenOutdoor?: boolean;
26
48
  theme?: ThemeType;
27
49
  collapseCopyright?: boolean;
50
+ selectedBuildingBorderStyle?: ISelectedBuildingBorderStyle;
51
+ floorsControlStyle?: IFloorsControlStyle;
52
+ floorSwitchMode?: FloorSwitchMode;
28
53
  }
29
54
  export type Listener = (param: Object) => any;
30
55
  declare class DefinedEvent {
@@ -47,23 +72,17 @@ export declare class Evented {
47
72
  private _eventedParent;
48
73
  private _eventedParentData;
49
74
  /**
50
- * Adds a listener to a specified event type.
51
- *
52
- * @param {string} type The event type to add a listen for.
53
- * @param {Function} listener The function to be called when the event is fired.
54
- * The listener function is called with the data object passed to `fire`,
55
- * extended with `target` and `type` properties.
56
- * @returns {Object} `this`
75
+ * @description Register a new event listener
76
+ * @param type name of the event(a unique string)
77
+ * @param listener event handler, it will be called when the event is fired
57
78
  */
58
- on(type: any, listener: Listener): this;
79
+ on(type: string, listener: Listener): this;
59
80
  /**
60
- * Removes a previously registered event listener.
61
- *
62
- * @param {string} type The event type to remove listeners for.
63
- * @param {Function} listener The listener function to remove.
64
- * @returns {Object} `this`
81
+ * @description Remove a registered event listener
82
+ * @param type name of the event
83
+ * @param listener event handler
65
84
  */
66
- off(type: any, listener: Listener): this;
85
+ off(type: string, listener: Listener): this;
67
86
  /**
68
87
  * Adds a listener that will be called only once to a specified event type.
69
88
  *
@@ -91,81 +110,19 @@ export declare class Evented {
91
110
  */
92
111
  setEventedParent(parent: Evented, data?: Object | (() => Object)): this;
93
112
  }
94
- export interface IMultiLangName {
95
- default: string;
96
- en: string;
97
- "zh-Hans"?: string;
98
- "zh-Hant"?: string;
99
- ja?: string;
100
- ko?: string;
101
- }
102
- export interface IBbox {
103
- maxLat: number;
104
- maxLon: string;
105
- minLat: number;
106
- minLon: number;
107
- }
108
- export interface IBuilding {
109
- building: string;
110
- id: string;
111
- label_center: string;
112
- level_ids: string;
113
- level_names: string;
114
- name: string;
115
- "name:en": string;
116
- "name:zh-Hant": string;
117
- ordinals: string;
118
- "ref:venue": string;
119
- type: string;
113
+ export interface IFloor {
114
+ code: string | null;
115
+ id: string | null;
116
+ ordinal: string | null;
120
117
  }
121
- export interface IFeatureBuilding extends MapGeoJSONFeature {
122
- properties: IBuilding;
123
- geometry: Polygon;
124
- }
125
- export interface ISearchBuilding {
126
- address: {
127
- [key in keyof IMultiLangName]: {
128
- housenumber: string;
129
- street: string;
130
- };
131
- };
132
- bbox: IBbox;
133
- buildingId: string;
134
- buildingOutlineId: number;
135
- city?: string;
136
- country: string;
137
- floors: {
138
- code: string;
139
- id: string;
140
- ordinal: number;
141
- signalMap: boolean;
142
- visualMap: boolean;
143
- }[];
144
- groundFloor: string;
145
- isPrivate: "yes" | "no";
146
- labelCenter: {
147
- lat: number;
148
- lon: number;
149
- };
150
- name: IMultiLangName;
151
- organization: string;
152
- region: string;
153
- signalMap: boolean;
154
- type: string;
155
- venueId: string;
156
- venueName: IMultiLangName;
157
- }
158
- /**
159
- * Indoor map core logic
160
- */
161
118
  export declare class Indoor extends Evented {
162
119
  private _map;
163
120
  private _features;
164
121
  private _curBuildingId;
165
122
  private _curBuildingFeature;
166
- private _curOrdinal;
167
- private _curLevelId;
168
- private _curFloor;
123
+ private _ordinal;
124
+ private _floorId;
125
+ private _floorName;
169
126
  private _buildingFloors;
170
127
  private _buildingOrdinals;
171
128
  private _enableSwitch;
@@ -178,100 +135,172 @@ export declare class Indoor extends Evented {
178
135
  private _footprints;
179
136
  private readonly _displayLevelSet;
180
137
  private _curVenueLevelMap;
138
+ private _curBuildingLevelMap;
181
139
  private _isSelectBuildingByClickMap;
182
- private static isFilterHasBeenReset;
183
- private static isLevel;
184
- private static isPoi;
185
- private static getBuildingPoint;
186
- constructor(map: maplibreMap, isHiddenOutdoor?: boolean);
187
- /** Turn on the indoor and outdoor switching */
140
+ private _buildingHighlightStyle;
141
+ private readonly _floorSwitchMode;
142
+ private readonly _initBuilding;
143
+ private _dispatch;
144
+ constructor(map: maplibreMap, isHiddenOutdoor?: boolean, floorSwitchMode?: FloorSwitchMode, initBuilding?: string);
145
+ /**
146
+ * @description Turn on indoor-outdoor switching.
147
+ */
188
148
  enableSwitch(): this;
189
- /** Turn off the indoor and outdoor switching */
149
+ /**
150
+ * @description Turn off indoor-outdoor switching.
151
+ */
190
152
  disableSwitch(): this;
191
- /** Turn on the buildings switching */
153
+ /**
154
+ * @description Turn on building-building switching.
155
+ */
192
156
  enableSwitchBuilding(): this;
193
- /** Turn off the buildings switching */
157
+ /**
158
+ * @description Turn off building-building switching.
159
+ */
194
160
  disableSwitchBuilding(): this;
195
161
  /**
196
- * Get the selected building's floor list
197
- * @return {string[]}
162
+ * @description Get a list of floors of the selected building
163
+ * @deprecated You can use "indoor.building" instead
164
+ * @returns {string[]}
198
165
  */
199
166
  get floors(): string[];
200
167
  /**
201
- * Get the selected building's ordinal list
168
+ * @description Get the selected building's ordinal list
169
+ * @deprecated You can use "indoor.building" instead
202
170
  * @return {string[]}
203
171
  */
204
172
  get ordinals(): string[];
205
173
  /**
206
- * Get the selected building's id
174
+ * @description Get the selected building's id
175
+ * @deprecated You can use "indoor.building" instead
207
176
  * @returns {string}
208
177
  */
209
178
  get buildingId(): string;
210
179
  /**
211
- * Get current floor of the selected building
212
- * @returns {string}
180
+ * @description Get current floor of the selected building
181
+ * @deprecated You should use "indoor.floor" instead
182
+ * @returns {string | null}
213
183
  */
214
- get currentFloor(): string;
184
+ get currentFloor(): string | null;
215
185
  /**
216
- * Get current ordinal of selecting building
186
+ * @description Get current ordinal of selecting building
187
+ * @deprecated you should use "indoor.floor" instead
188
+ * @returns {string | null}
217
189
  */
218
190
  get ordinal(): string | null;
219
191
  /**
220
- * Get current venueId
192
+ * @description Get current venueId
193
+ * @deprecated You should use the new getter 'venue' instead
194
+ * @returns {string | null}
221
195
  */
222
196
  get venueId(): string | null;
223
197
  /**
224
- * Get referred level of selecting building
225
- * @returns {string}
198
+ * @description Get current floor id
199
+ * @deprecated You can use "indoor.floor" instead
200
+ * @returns {string | null}
201
+ */
202
+ get floorId(): string | null;
203
+ /**
204
+ * @description Get the current floor's information.
226
205
  */
227
- get refLevel(): string;
206
+ get floor(): IFloor;
228
207
  /**
229
- * Get the tiles of bbox
230
- * @returns {IFeatureBuilding[]}
208
+ * @description Get the current building's information.
209
+ * @returns {MapGeoJSONFeature | null}
210
+ */
211
+ get building(): MapGeoJSONFeature | null;
212
+ /**
213
+ * @description Get the current venue's information.
214
+ * @returns {MapGeoJSONFeature | null}
215
+ */
216
+ get venue(): MapGeoJSONFeature | null;
217
+ /**
218
+ * @description Get the geo features of bbox.
231
219
  */
232
220
  get features(): MapGeoJSONFeature[];
233
221
  /**
234
- * Get the feature by the specified id
235
- * @param id: {string}
222
+ * @description Get specified feature of bbox by id.
223
+ * @param id
236
224
  * @return {MapGeoJSONFeature | undefined}
237
225
  */
238
226
  getFeature(id: string): MapGeoJSONFeature | undefined;
239
227
  /**
240
- * Get the building at the point
241
- * @param point: {PointLike}
242
- * @return {IFeatureBuilding | undefined}
228
+ * @description Get building feature at the point
229
+ * @deprecated You can use "map.onMapClickListener" instead
230
+ * @param point {PointLike}
231
+ * @return {MapGeoJSONFeature | null}
243
232
  */
244
- getBuildingByPoint(point?: PointLike): IFeatureBuilding | undefined;
233
+ getBuildingByPoint(point: PointLike): MapGeoJSONFeature | null;
245
234
  /**
246
- * Select a building feature
247
- * @param feature: {IFeatureBuilding | null}
235
+ * @description Get level feature at the point
236
+ * @param point
237
+ * @return {MapGeoJSONFeature | null}
248
238
  */
249
- selectBuilding(feature?: IFeatureBuilding | null): void;
239
+ getLevelByPoint(point: PointLike): MapGeoJSONFeature | null;
250
240
  /**
251
- * Switch to the building feature
252
- * @param feature: {IFeatureBuilding}
241
+ * @description Pan to and select a building by buildingId and floorId
242
+ * @deprecated You should use the "panToBuilding" instead
243
+ * @param buildingId {string}
244
+ * @param floorId {string}
245
+ * @param callback
253
246
  */
254
- switchBuilding(feature: IFeatureBuilding): void;
247
+ goToBuilding(buildingId: string, floorId?: string, callback?: (feature: MapGeoJSONFeature) => void): void;
255
248
  /**
256
- * Select a building and pan to the building
257
- * @param buildingId: {string}
249
+ * @description Map pan to the building center and select the building.
250
+ * @param buildingId
251
+ * @param floorId
258
252
  * @param callback
259
253
  */
260
- goToBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): void;
254
+ panToBuilding(buildingId: string, floorId?: string, callback?: (feature: MapGeoJSONFeature) => void): void;
261
255
  /**
262
- * Switch floor to filter features
263
- * @param ordinal: {string}
256
+ * @description Switch floor by ordinal
257
+ * @deprecated You should use the "switchFloorByOrdinal" instead
258
+ * @param ordinal {string}
264
259
  */
265
260
  switchFloor(ordinal: string): void;
266
261
  /**
267
- * Hide the outdoor map
268
- * @param isHiddenOutdoor: {boolean}
262
+ * @description Switch floor by ordinal.
263
+ * @param ordinal
264
+ */
265
+ switchFloorByOrdinal(ordinal: string): void;
266
+ /**
267
+ * @description Hide the outdoor layer.
268
+ * @param isHiddenOutdoor
269
269
  */
270
270
  hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
271
- /** Update map after the style changed */
271
+ /**
272
+ * @description Update map layout.
273
+ */
272
274
  updateLayers(): void;
273
- /** filter the layers */
275
+ /**
276
+ * @description Filter indoor layers.
277
+ */
274
278
  setFloorsFilter(): void;
279
+ /**
280
+ * @description Set the style of SelectedBuildingBorder.
281
+ * @param style {ISelectedBuildingBorderStyle | null}
282
+ */
283
+ setSelectedBuildingBorderStyle(style: ISelectedBuildingBorderStyle | null): void;
284
+ /**
285
+ * @description Listen for the indoor map state, including the changes of venue, building and floor.
286
+ * @param listener
287
+ */
288
+ onMapChange(listener: (params: {
289
+ venue: MapGeoJSONFeature | null;
290
+ building: MapGeoJSONFeature | null;
291
+ floor: IFloor;
292
+ }) => void): {
293
+ unsubscribe: VoidFunction;
294
+ };
295
+ /**
296
+ * @description Select a building feature
297
+ * @deprecated Use map.selectBuildingById instead
298
+ * @param feature {MapGeoJSONFeature | null}
299
+ * @param floorId {string}
300
+ */
301
+ selectBuilding(feature?: MapGeoJSONFeature | null, floorId?: string): void;
302
+ private _selectBuilding;
303
+ private _getBuildingByPoint;
275
304
  private _getConditionsExpression;
276
305
  private _loadData;
277
306
  private _init;
@@ -281,30 +310,13 @@ export declare class Indoor extends Evented {
281
310
  private _setPoiTextColor;
282
311
  private _addTextHaloColor;
283
312
  private _getFeatures;
284
- /**
285
- * @description 获取 building ordinal: 有 floor 参数则返回该 floor 对应的 ordinal;
286
- * @description 无则优先返回历史 ordinal 再是离地面层最近的 ordinal.
287
- * @param buildingFeature: {MapGeoJSONFeature}
288
- * @param floor?: {string}
289
- * @private
290
- */
291
- private _getBuildingOrdinal;
292
- /**
293
- * 获取当前 building floor
294
- * @private
295
- */
296
- private _getBuildingFloor;
297
- /**
298
- * @description Get building level_names and ordinals
299
- * @param buildingFeature
300
- * @private
301
- */
302
- private _getBuildingProps;
313
+ private _getBuildingFloorByOrdinal;
314
+ private _getBuildingFloorByFloorId;
315
+ private _getBuildingFloorsAndOrdinals;
303
316
  private _isNotCurrentFeature;
304
317
  private _setOutdoorLayersHidden;
305
318
  private _addCustomLevelFillLayer;
306
- private _setSelectedVenueState;
307
- private _setLayerTransparency;
319
+ private _setIndoorState;
308
320
  private _setBuildingHighlight;
309
321
  private _addBuildingHighlightLayer;
310
322
  private _filterBuildingHighlight;
@@ -312,39 +324,44 @@ export declare class Indoor extends Evented {
312
324
  private _removeDisplayLevels;
313
325
  private _setDisplayLevels;
314
326
  private _cacheCurVenueLevels;
315
- private _getDisplayLevels;
316
- private _getVenueOrdinal;
317
- private _getBuildingLevelByOrdinal;
318
- private _isBuildingLayer;
319
- private _isVenueLayer;
327
+ private _cacheCurBuildingLevels;
328
+ /**
329
+ * @description priority: history > default_displayed_floor > ordinal equal to or closest to 0
330
+ * @param building
331
+ * @private
332
+ */
333
+ private _getBuildingOrdinal;
334
+ private _getFloorIdByOrdinal;
320
335
  /**
321
336
  * @description 判断当前 building 是否为隐藏式 building,即点击的 building 无显示元素
322
337
  * @param building
323
338
  * @private
324
339
  */
325
340
  private _isHiddenBuilding;
326
- }
327
- export interface IFloorsControlStyle {
328
- fontColor?: string;
329
- selectFontColor?: string;
330
- selectBoxColor?: string;
341
+ private _isVenueMode;
342
+ private _getDisplayLevelsByVenueMode;
343
+ private _getDisplayLevelsByBuildingMode;
344
+ private _getUnselectedVenueOrdinal;
345
+ private _getBuildingFloor;
346
+ private static isFilterHasBeenReset;
331
347
  }
332
348
  export interface IPoiEvent {
333
- lngLat: maplibregl.LngLat;
334
- originalEvent: Event;
335
- point: PointLike;
336
- feature: Feature<GeometryObject>;
349
+ coordinate: LngLat;
350
+ poi: MapGeoJSONFeature;
351
+ building: MapGeoJSONFeature | null;
352
+ venue: MapGeoJSONFeature | null;
353
+ floor: IFloor;
337
354
  }
338
- export interface IFloorEvent {
339
- floor: string;
340
- ordinal: string;
341
- feature: Feature<GeometryObject>;
355
+ export interface IPointEvent {
356
+ coordinate: LngLat;
357
+ point: PointLike;
342
358
  }
343
- export interface IMapClickEvent extends Event {
344
- point?: PointLike;
345
- feature?: IFeatureBuilding;
359
+ export interface IMapClickEvent {
360
+ coordinate: LngLat;
361
+ building: MapGeoJSONFeature | null;
362
+ venue: MapGeoJSONFeature | null;
363
+ floor: IFloor;
346
364
  }
347
- export type TPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
348
365
  export declare class Map extends Evented {
349
366
  private _map;
350
367
  private _indoor;
@@ -353,389 +370,429 @@ export declare class Map extends Evented {
353
370
  private _enableFloorControl;
354
371
  private _enableBuildingSelector;
355
372
  private _poi;
356
- private _buildingId;
357
373
  private _initialHiddenLayers;
358
374
  private _attributionControl;
359
375
  private _mapZoom;
360
376
  private _dispatch;
361
- private static _getThemeStyleName;
362
377
  constructor(option: IMapOption);
363
378
  /**
364
- * Map completely init
365
- * @param {Function} callback all map operations
379
+ * @description This function will be called once the indoor source loaded.
380
+ * @param callback
366
381
  */
367
- renderComplete(callback: (event: Event) => void): void;
382
+ renderComplete(callback: VoidFunction): void;
368
383
  /**
369
- * Get indoor information: buildingId, floors...
370
- * @returns {Indoor}
384
+ * @description Get map indoor instance.
371
385
  */
372
386
  getIndoor(): Indoor;
373
- /** Get map instance */
374
- getMap(): maplibreMap;
375
387
  /**
376
- * Convert the POI text to the specified language
377
- * @param language: {string}
388
+ * @description Get maplibre map instance.
389
+ */
390
+ getMap(): MaplibreMap;
391
+ /**
392
+ * @description Translate POI name to the specified language.
393
+ * @param language Window.navigator.language.
378
394
  */
379
395
  transformPoiTextFieldLanguage(language: string): void;
380
- /** Turn on indoor and outdoor switching */
396
+ /**
397
+ * @description Turn on indoor-outdoor switching.
398
+ */
381
399
  enableSwitch(): this;
382
- /** Turn off indoor and outdoor switching */
400
+ /**
401
+ * @description Turn off indoor-outdoor switching.
402
+ */
383
403
  disableSwitch(): this;
384
- /** Turn on the buildings switching */
404
+ /**
405
+ * @description Turn on building-building switching.
406
+ */
385
407
  enableSwitchBuilding(): this;
386
- /** Turn off the buildings switching */
408
+ /**
409
+ * @description Turn off building-building switching.
410
+ */
387
411
  disableSwitchBuilding(): this;
388
412
  /**
389
- * To hide the outdoor map
390
- * @param isHiddenOutdoor: {boolean}
413
+ * @description Set outdoor layer to be shown or hidden.
414
+ * @deprecated You can use "map.setOutdoorLayerHidden" instead.
415
+ * @param isHiddenOutdoor True is hidden, false is shown.
391
416
  */
392
417
  hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
393
418
  /**
394
- * Get a list of floors of the selected building
419
+ * @description Set outdoor layer to be shown or hidden.
420
+ * @param isHidden True is hidden, false is shown.
421
+ */
422
+ setOutdoorLayerHidden(isHidden: boolean): void;
423
+ /**
424
+ * @description Get a list of floors of the selected building
425
+ * @deprecated You can use "map.building" instead
395
426
  * @returns {string[]}
396
427
  */
397
428
  get floors(): string[];
398
429
  /**
399
- * Get the current floor of the selected building
400
- * @returns {string}
430
+ * @description Get the current floor of the selected building
431
+ * @deprecated You can get the current floor by "map.floor"
432
+ * @returns {string | null}
401
433
  */
402
- get currentFloor(): string;
434
+ get currentFloor(): string | null;
403
435
  /**
404
- * Get the current ordinal of the selected building
436
+ * @description Get the current ordinal of the selected building
437
+ * @deprecated You can use "map.floor" instead
438
+ * @returns {string | null}
405
439
  */
406
440
  get ordinal(): string | null;
407
441
  /**
408
- * Get venueId which the selected building belongs
442
+ * @description Get venueId which the selected building belongs
443
+ * @deprecated You can use "map.venue" instead
444
+ * @returns {string | null}
409
445
  */
410
446
  get venueId(): string | null;
411
447
  /**
412
- * Get the selected building properties
413
- * @returns {IBuilding | undefined}
448
+ * @description Get current selected floor info.
449
+ * @return {IFloor | null}
450
+ */
451
+ get floor(): IFloor | null;
452
+ /**
453
+ * @description Get current selected building info.
454
+ * @return {MapGeoJSONFeature | null}
455
+ */
456
+ get building(): MapGeoJSONFeature | null;
457
+ /**
458
+ * @description Get current selected venue info.
459
+ * @return {MapGeoJSONFeature | null}
414
460
  */
415
- get building(): IBuilding | undefined;
461
+ get venue(): MapGeoJSONFeature | null;
416
462
  /**
417
- * Get feature by the specified id
418
- * @param id: {string}
463
+ * @description Get feature in bbox by id.
464
+ * @param id
465
+ * @return {MapGeoJSONFeature | undefined}
419
466
  */
420
467
  getFeature(id: string): MapGeoJSONFeature | undefined;
421
468
  /**
422
- * Select the building feature to enter its indoor
423
- * @param feature: {IFeatureBuilding}
469
+ * @description Select the building feature to enter its indoor
470
+ * @deprecated You can use "map.selectBuildingById" or "map.selectVenueById" instead
471
+ * @param feature {MapGeoJSONFeature | null} If feature is null then exit indoor
424
472
  */
425
- selectBuilding(feature: IFeatureBuilding): this;
473
+ selectBuilding(feature: MapGeoJSONFeature | null): this;
426
474
  /**
427
- * Switch the selected building to be the specified id
428
- * @param buildingId: {string}
475
+ * @description Switch the selected building to be the specified id
476
+ * @deprecated You can use "map.selectBuildingById" instead
477
+ * @param buildingId {string}
429
478
  * @param callback
430
479
  */
431
- switchBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): this;
480
+ switchBuilding(buildingId: string, callback?: (feature: MapGeoJSONFeature) => void): this;
432
481
  /**
433
- * Switch to the specified floor
434
- * @param floor: {string}
482
+ * @description Switch to the specified floor
483
+ * @deprecated You can use "map.selectFloorById" instead
484
+ * @param floor {string}
435
485
  * @param callback
436
486
  */
437
- switchFloor(floor: string, callback?: (object: IFloorEvent) => void): this;
487
+ switchFloor(floor: string, callback?: (feature: MapGeoJSONFeature) => void): this;
488
+ /**
489
+ * @description Select floor by id.
490
+ * @param floorId
491
+ * @param callback Called after floor has been selected.
492
+ */
493
+ selectFloorById(floorId: string, callback?: VoidFunction): Promise<this>;
438
494
  /**
439
- * Listen for mouse click events on the map
495
+ * @description Select building by id.
496
+ * @param buildingId
497
+ * @param callback Called after building has been selected
498
+ */
499
+ selectBuildingById(buildingId: string, callback?: VoidFunction): this;
500
+ /**
501
+ * @description Select or exit venue by id.
502
+ * @param venueId Exit venue if venueId is null.
503
+ * @param callback Called after venue has been selected.
504
+ */
505
+ selectVenueById(venueId: string | null, callback?: VoidFunction): Promise<this>;
506
+ /**
507
+ * @description Listen for mouse click events on the map.
440
508
  * @param listener
441
- * @return {unsubscribe}: to remove the event listener
442
509
  */
443
510
  onMapClickListener(listener: (event: IMapClickEvent) => void): {
444
- unsubscribe: Function;
511
+ unsubscribe: VoidFunction;
445
512
  };
446
513
  /**
447
- * Listen for the indoor POI click events
514
+ * @description Listen for mouse click events on indoor POI
448
515
  * @param listener
449
- * @return {unsubscribe}: to remove the event listener
450
516
  */
451
- onIndoorPoiListener(listener: (result: IPoiEvent) => void): {
452
- unsubscribe: Function;
517
+ onPoiClickListener(listener: (param: IPoiEvent) => void): {
518
+ unsubscribe: VoidFunction;
453
519
  };
454
520
  /**
455
- * Listen for the selected floor changed event
521
+ * @description Listen for mouse click events at a point.
456
522
  * @param listener
457
- * @return {unsubscribe}: to remove the event listener
458
523
  */
459
- onFloorChangeListener(listener: (result: IFloorEvent) => void): {
460
- unsubscribe: Function;
524
+ onPointClickListener(listener: (result: IPointEvent) => void): {
525
+ unsubscribe: VoidFunction;
461
526
  };
462
527
  /**
463
- * Listen for the selected building changed event
464
- * @param listener
465
- * @return {unsubscribe}: to remove the event listener
528
+ * @description Listen for the selected floor changed event
529
+ * @deprecated You can use the "map.onMapChangeListener" instead
530
+ * @param listener {function} (feature: MapGeoJSONFeature | null) => void
531
+ * @return {unsubscribe} To remove the event listener
466
532
  */
467
- onBuildingChangeListener(listener: (feature: IFeatureBuilding | null) => void): {
468
- unsubscribe: Function;
533
+ onFloorChangeListener(listener: (feature: MapGeoJSONFeature | null) => void): {
534
+ unsubscribe: VoidFunction;
469
535
  };
470
536
  /**
471
- * Listen for the selected venue changed event
472
- * @param {function} listener: (venueId: string | null, ordinal: string | null) => void
473
- * @return {unsubscribe}: function to remove the event listener
537
+ * @description Listen for the selected building changed event
538
+ * @deprecated You can use the "map.onMapChangeListener" instead
539
+ * @param listener {function} (feature: MapGeoJSONFeature | null) => void
540
+ * @return {unsubscribe} To remove the event listener
541
+ */
542
+ onBuildingChangeListener(listener: (feature: MapGeoJSONFeature | null) => void): {
543
+ unsubscribe: VoidFunction;
544
+ };
545
+ /**
546
+ * @description Listen for the selected venue changed event
547
+ * @deprecated You can use the "map.onMapChangeListener" instead
548
+ * @param listener {function} (feature: MapGeoJSONFeature | null) => void
549
+ * @return {unsubscribe} To remove the event listener
550
+ */
551
+ onVenueChangeListener(listener: (feature: MapGeoJSONFeature | null) => void): {
552
+ unsubscribe: VoidFunction;
553
+ };
554
+ /**
555
+ * @description Listen for the indoor map status, including the changes of venue, building and floor.
556
+ * @param listener
474
557
  */
475
- onVenueChangeListener(listener: (venueId: string | null, ordinal: string | null) => void): {
476
- unsubscribe: Function;
558
+ onMapChangeListener(listener: (params: {
559
+ venue: MapGeoJSONFeature | null;
560
+ building: MapGeoJSONFeature | null;
561
+ floor: IFloor;
562
+ }) => void): {
563
+ unsubscribe: VoidFunction;
477
564
  };
478
- /** Hide the FloorControl */
565
+ /**
566
+ * @description Hide the FloorControl.
567
+ */
479
568
  disableFloorControl(): this;
480
569
  /**
481
- * set the FloorControl enabled
482
- * @param position: TPosition
570
+ * @description Show the FloorControl.
571
+ * @param position
572
+ */
573
+ enableFloorControl(position?: ControlPosition): this;
574
+ /**
575
+ * @description Hide the BuildingSelector.
483
576
  */
484
- enableFloorControl(position?: TPosition): this;
485
- /** Hide the BuildingSelector */
486
577
  disableBuildingSelector(): this;
487
578
  /**
488
- * set the BuildingSelector enabled
489
- * @param position: TPosition
579
+ * @description Show the BuildingSelector.
580
+ * @param position
490
581
  */
491
- enableBuildingSelector(position?: TPosition): this;
582
+ enableBuildingSelector(position?: ControlPosition): this;
492
583
  /**
493
- * switch the map style
494
- * @param theme: {string}
584
+ * @description Switch the map style
585
+ * @param theme ThemeType | string(customized map style file name)
495
586
  */
496
587
  switchTheme(theme: string): void;
497
588
  /**
498
- * set the floorsControl's style
499
- * @param style: {IFloorsControlStyle}
589
+ * @description Set the floorsControl's style.
590
+ * @param style
500
591
  */
501
592
  setFloorsControlStyle(style: IFloorsControlStyle): void;
593
+ /**
594
+ * @description Set the SelectedBuildingBorder's style
595
+ * @param style {ISelectedBuildingBorderStyle | null}
596
+ */
597
+ setSelectedBuildingBorderStyle(style: ISelectedBuildingBorderStyle | null): void;
598
+ private static _getThemeStyleName;
502
599
  private _setIndoorFilter;
503
600
  private _setStyle;
504
601
  private _addControl;
505
602
  private _defaultSetMapZoom;
506
- private _defaultSelectedBuilding;
507
- private _defaultSelectedPoi;
508
- }
509
- export type TCoordinates = [
510
- number,
511
- number
512
- ] | [
513
- number,
514
- number
515
- ][];
516
- /**
517
- * Map marker
518
- * support all browser event
519
- * support floor and building switch
520
- * allow to define icon and scale
521
- */
522
- export declare class Marker extends Evented {
523
- private _map;
603
+ private _selectPoiById;
604
+ private _getBuildingIdByVenueId;
605
+ private _getBuildingOrdinalByFloor;
606
+ }
607
+ export type TAnchorPosition = "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
608
+ export declare class Marker {
524
609
  private _maplibreMap;
525
- private _coordinates;
526
- private _floor;
527
- private _buildingId;
528
- private readonly _sourceId;
529
610
  private readonly _layerId;
611
+ private readonly _sourceId;
530
612
  private _imageName;
531
- private _imageUrl;
532
- private _imageScale;
613
+ private _imageSize;
614
+ private _iconAnchor;
615
+ constructor(maplibreMap: MaplibreMap);
533
616
  /**
534
- * Determine whether the coordinates are multi array
535
- *
536
- * @private
537
- * @returns {boolean}
617
+ * @description Set marker by sprite name.
618
+ * @param imageName Icon sprite name in map style.
538
619
  */
539
- private static isMultiArray;
540
- constructor(map?: Map);
620
+ setIconImage(imageName: string): void;
541
621
  /**
542
- * @deprecated This method should not be used
543
- * @param map
622
+ * @description Set marker by image url.
623
+ * @param imageUrl Network url, png format.
544
624
  */
545
- addTo(map: Map): this;
625
+ setIconImageUrl(imageUrl: string): void;
546
626
  /**
547
- * Set up marker handle event
548
- *
549
- * @public
550
- * @param {string} type browser event type, eq. click、dbclick、mouseenter
551
- * @param {function} callback marker event callback
627
+ * @description Set marker image size.
628
+ * @param imageScale Default is 1.
552
629
  */
553
- onEventListener(type: string, callback: (ev: MapMouseEvent) => void): void;
630
+ setIconSize(imageScale: number): void;
554
631
  /**
555
- * Create marker content, must have coordinates
556
- * Markers with the same building and floor can be appended by this function
557
- * @public
558
- * @param {number[] | number[][]} coordinates normal array is single point, two-dimensional array is multi points
559
- * @param {string} floor optional, binding the marker floor, showing markers by floor
560
- * @param {string} buildingId optional, binding the marker building, showing markers by building
632
+ * @description Set marker image anchor. Part of the icon placed closest to the anchor.
633
+ * @param anchor
561
634
  */
562
- create(coordinates: TCoordinates, floor?: string, buildingId?: string): this;
635
+ setIconAnchor(anchor: TAnchorPosition): void;
563
636
  /**
564
- * Remove marker data
565
- * no data that will be hidden
566
- *
567
- * @public
637
+ * @description Marker layer id getter.
568
638
  */
569
- remove(): this;
639
+ get layerId(): string;
570
640
  /**
571
- * @deprecated This method should not be used
572
- * @param floor
573
- * @param buildingId
641
+ * @description Marker source id getter.
574
642
  */
575
- switch(floor: string, buildingId: string): this;
643
+ get sourceId(): string;
576
644
  /**
577
- * Get marker layer id value
578
- *
579
- * @public
580
- * @returns {string}
645
+ * @description Create marker[s] source and layer.
646
+ * @param array Coordinate and properties arrays of marker[s].
581
647
  */
582
- get layerId(): string;
648
+ create(array: Array<{
649
+ lngLat: [
650
+ number,
651
+ number
652
+ ];
653
+ properties?: {
654
+ [k: string]: string;
655
+ };
656
+ }>): void;
583
657
  /**
584
- * Get marker source id value
585
- *
586
- * @public
587
- * @returns {string}
658
+ * @description Remove marker[s] layer and source.
588
659
  */
589
- get sourceId(): string;
660
+ remove(): void;
590
661
  /**
591
- * Setup define marker icon network url
592
- *
593
- * @public
594
- * @param {string} imageUrl network url, allow format is png、gif、jpg
662
+ * @description Add marker event listener.
663
+ * @param eventKey
664
+ * @param callback
595
665
  */
596
- setImageUrl(imageUrl: string): this;
666
+ onEventListener(eventKey: keyof MapLayerEventType, callback: (marker: GeoJSONFeature) => void): void;
597
667
  /**
598
- * Setup define marker icon scale
599
- *
600
- * @public
601
- * @param {number} imageScale 0.1 - 10
668
+ * @description Filter marker by custom properties.
669
+ * @param filterExpression A expression specifying conditions on source features.
670
+ * Only features that match the filter are displayed. Refer:
671
+ * https://maplibre.org/maplibre-style-spec/expressions/
602
672
  */
603
- setImageScale(imageScale: number): this;
604
- private _bindEvents;
673
+ setFilter(filterExpression: FilterSpecification): void;
605
674
  /**
606
- * Create marker data, contain source and layer
607
- * 1. create source
608
- * 2. create layer
609
- *
610
- * @private
675
+ * @description Filter marker by venueId and ordinal.
676
+ * Required 'venueId' and 'ordinal' in properties.
677
+ * Markers not matched 'venueId' and 'ordinal' would be hidden;
678
+ * Outdoor markers always are shown.
679
+ * @param venueId {string | null | undefined}
680
+ * @param ordinal {string | null | undefined}
611
681
  */
612
- private _createData;
682
+ setFilterByVenue(venueId: string | null | undefined, ordinal: string | null | undefined): void;
613
683
  /**
614
- * Load and set the marker icon.
615
- *
616
- * @private
617
- * @param url
618
- * @param {function} callback loaded callback function
684
+ * @description Filter marker by buildingId and ordinal.
685
+ * Required 'buildingId' and 'ordinal' in properties.
686
+ * Markers not matched 'buildingId' and 'ordinal' would be hidden;
687
+ * Outdoor markers always are shown.
688
+ * @param buildingId {string | null | undefined}
689
+ * @param ordinal {string | null | undefined}
619
690
  */
620
- private _loadImage;
691
+ setFilterByBuilding(buildingId: string | null | undefined, ordinal: string | null | undefined): void;
621
692
  /**
622
- * Add marker data source, contain marker properties
623
- *
624
- * @private
693
+ * @description Set marker's icon-opacity by custom properties.
694
+ * @param filterExpression A expression specifying conditions on source features.
695
+ * Only features that match the filter are displayed. Refer:
696
+ * https://maplibre.org/maplibre-style-spec/expressions/
625
697
  */
626
- private _addSource;
698
+ setOpacity(filterExpression: FilterSpecification): void;
627
699
  /**
628
- * Add marker data layer, contain marker style
629
- *
630
- * @private
700
+ * @description Set marker's icon-opacity by venueId and ordinal.
701
+ * Required 'venueId' and 'ordinal' in properties.
702
+ * Opacities of markers matched 'venueId' and 'ordinal' are 1, others are 0.5.
703
+ * Outdoor markers' opacity always are 1.
704
+ * @param venueId {string | null | undefined}
705
+ * @param ordinal {string | null | undefined}
631
706
  */
632
- private _addLayer;
633
- private _setFilter;
707
+ setOpacityByVenue(venueId: string | null | undefined, ordinal: string | null | undefined): void;
708
+ /**
709
+ * @description Set marker's icon-opacity by buildingId and ordinal.
710
+ * Required 'buildingId' and 'ordinal' in properties.
711
+ * Opacities of markers matched 'buildingId' and 'ordinal' are 1, others are 0.5.
712
+ * Outdoor markers' opacity always are 1.
713
+ * @param buildingId {string | null | undefined}
714
+ * @param ordinal {string | null | undefined}
715
+ */
716
+ setOpacityByBuilding(buildingId: string | null | undefined, ordinal: string | null | undefined): void;
717
+ private _createIconFeature;
718
+ private _addIconSource;
719
+ private _addIconLayer;
634
720
  }
635
721
  export declare class Poi {
636
722
  private _map;
637
- private _layers;
723
+ private _layerIds;
638
724
  private _dispatch;
639
- constructor(map: maplibregl.Map);
725
+ constructor(map: MaplibreMap);
640
726
  /**
641
- * Listen for the POI clicked event
727
+ * @description Listen for POI click events.
642
728
  * @param listener
643
- * @return {unsubscribe}: to remove the event listener
644
729
  */
645
- onPointClick(listener: (result: IPoiEvent) => void): {
646
- unsubscribe: Function;
730
+ onPoiClick(listener: (param: IPoiEvent) => void): {
731
+ unsubscribe: VoidFunction;
647
732
  };
648
- /**
649
- * Init the data after the style data is loaded
650
- * @private
651
- */
652
- private _loadData;
653
- /**
654
- * 1. Get layer id is match `poi` name data
655
- * 2. Init map on-click event
656
- *
657
- * @private
658
- */
733
+ private _bindEvents;
659
734
  private _init;
660
- /**
661
- * Map on-click poi event
662
- * if have poiClickFunction callback
663
- * and then return the poi data to callback function
664
- *
665
- * @private
666
- */
667
- private _initClick;
735
+ private _initPoiClick;
736
+ private _getFloorDataByFloorId;
668
737
  }
669
738
  export declare class FloorsControl implements IControl {
670
- private _map;
671
- private _$container;
739
+ private _container;
672
740
  private _indoor;
673
- private _$layout;
674
- private _$outer;
675
- private _$inner;
676
- private _$arrowUp;
677
- private _$arrowDown;
678
- private _floor;
679
- private _buildingId;
680
- private _ordinal;
681
- private _fontColor;
682
- private _selectFontColor;
683
- private _selectBoxColor;
684
- private _$currentButton;
685
- private _$floorControlButtons;
686
- private _enableFloorControl;
687
741
  private _position;
742
+ private _floorNames;
743
+ private _ordinals;
744
+ private _buildingId;
745
+ private _selectorStyle;
746
+ private _$innerFloors;
747
+ private _$activeFloor;
748
+ private _centerSelectorIdx;
749
+ private _lastNormalScrollableIdx;
750
+ private _$arrowBtnUp;
751
+ private _$arrowBtnDown;
752
+ private _maxScrollTop;
753
+ private _$selectorExpanded;
754
+ private _$selectorFolded;
688
755
  private _dispatch;
689
- private static _$createFloor;
690
- constructor(map: Map, position?: TPosition);
691
- get position(): TPosition;
692
- get enabled(): boolean;
693
- onAdd(map: maplibreMap): HTMLElement;
756
+ private _componentDidMount;
757
+ private _isShown;
758
+ constructor(indoor: Indoor);
759
+ onAdd(): HTMLElement;
694
760
  onRemove(): void;
695
- switchBuildingFloor(floor: string, callback?: (object: IFloorEvent) => void): void;
696
- onFloorClick(listener: (result: IFloorEvent) => void): {
697
- unsubscribe: Function;
698
- };
699
- switchFloor(ordinal: string, callback?: (object: IFloorEvent) => void): void;
700
- setStyle(style: IFloorsControlStyle): void;
701
- setLayoutHidden(isHidden: boolean): void;
702
- moveFloorControl(from: TPosition, to: TPosition): void;
703
- private _listener;
761
+ getDefaultPosition(): ControlPosition;
704
762
  /**
705
- * Triggered when the user on-click on the building
706
- * 1. click current building
707
- * 2. click other building (new building)
708
- * @param event {IBuildingSelectEvent}
763
+ * @deprecated Use 'switchByOrdinal' instead
709
764
  */
710
- private _init;
765
+ switchByFloorName(floorName: string, callback?: (feature: MapGeoJSONFeature) => void): void;
766
+ switchByOrdinal(ordinal: string, callback?: (feature: MapGeoJSONFeature) => void): void;
767
+ setVisibility(visible: boolean): void;
768
+ setPosition(position: ControlPosition): void;
769
+ setStyle(style: Partial<IFloorsControlStyle> | null): void;
711
770
  /**
712
- * Triggered when the user move end on the map
771
+ * @deprecated
772
+ * @param listener
713
773
  */
714
- private _refresh;
715
- private _$createLayout;
716
- private _$configLayoutHeight;
717
- private _$configArrowDownTop;
718
- private _$showOrHideArrow;
719
- private _$showLayout;
720
- private _$hideLayout;
721
- private _$showArrowUp;
722
- private _$hideArrowUp;
723
- private _$showArrowDown;
724
- private _$hideArrowDown;
774
+ onFloorClick(listener: (feature: MapGeoJSONFeature) => void): {
775
+ unsubscribe: VoidFunction;
776
+ };
777
+ private _bindEvents;
778
+ private _clearData;
779
+ private _render;
780
+ private _hide;
781
+ private _show;
782
+ private _createSelector;
783
+ private _$expandedSelector;
784
+ private _$foldedSelector;
785
+ private _clearSelector;
786
+ private _$createScrollButton;
725
787
  private _$createFloors;
726
- private _$clearFloors;
727
- private _isEmptyFloors;
728
- private _isOverflowFloorMax;
729
- private _isEnableDisplay;
730
- private _scrollToClickedFloor;
731
- private _setCurrentButtonActive;
732
- private _floorClick;
733
- private _floorScroll;
734
- private _floorClickEvent;
735
- private _floorScrollEvent;
736
- private _bindEvent;
737
- private _getCurrentFloor;
738
- private _updateFloorControlStatus;
788
+ private _updateSelectorStatus;
789
+ private _resetArrowBtnStatus;
790
+ private _resetActiveFloor;
791
+ private _scrollCenterActiveFloor;
792
+ private _getScrollTop;
793
+ private _handleScroll;
794
+ private _expandSelector;
795
+ private _getCurrentLevelFeature;
739
796
  }
740
797
  export declare class BuildingFilterControl implements maplibregl.IControl {
741
798
  private _map;
@@ -747,19 +804,18 @@ export declare class BuildingFilterControl implements maplibregl.IControl {
747
804
  private _buildingNameList;
748
805
  private _enableBuildingSelector;
749
806
  private readonly _position;
750
- constructor(map: Map, position?: TPosition);
807
+ constructor(map: Map, position?: ControlPosition);
751
808
  onAdd(map: MaplibreMap): HTMLElement;
752
809
  onRemove(): void;
753
- get position(): TPosition;
810
+ get position(): ControlPosition;
754
811
  get enabled(): boolean;
755
812
  setLayoutHidden(isHidden: boolean): void;
756
- moveBuildingFilter(from: TPosition, to: TPosition): void;
813
+ moveBuildingFilter(from: ControlPosition, to: ControlPosition): void;
757
814
  private _loadData;
758
815
  private _init;
759
816
  private _refresh;
760
817
  private _select;
761
818
  private _load;
762
- private _getFeatureByName;
763
819
  private _buildingFilterIconCreate;
764
820
  private _buildingNameListCreate;
765
821
  private _buildingNameListUpdate;
@@ -772,23 +828,179 @@ export declare class BuildingFilterControl implements maplibregl.IControl {
772
828
  private _$showLayout;
773
829
  private _$hideLayout;
774
830
  }
775
- export interface IResponseBuildings {
776
- buildings: ISearchBuilding[];
777
- total: number;
778
- }
779
831
  export interface IResponse<T> {
780
832
  code: number;
781
833
  message: string;
782
834
  result: T;
783
835
  }
836
+ export type IPresetLanguage = "en" | "zh-Hans" | "zh-Hant" | "ja" | "ko";
837
+ export interface IMultiLangName extends Partial<Record<IPresetLanguage, string>> {
838
+ default: string;
839
+ }
840
+ export type IMultiLangAddress = Record<keyof IMultiLangName, {
841
+ housenumber: string;
842
+ street: string;
843
+ }>;
844
+ export interface IBbox {
845
+ maxLat: number;
846
+ maxLon: string;
847
+ minLat: number;
848
+ minLon: number;
849
+ }
850
+ export interface ILabelCenter {
851
+ lat: number;
852
+ lon: number;
853
+ }
854
+ export interface IBuildingFloor {
855
+ id: string;
856
+ code: string;
857
+ ordinal: number;
858
+ visualMap: boolean;
859
+ signalMap: boolean;
860
+ }
861
+ export interface IBuilding {
862
+ address: IMultiLangAddress;
863
+ bbox: IBbox;
864
+ buildingId: string;
865
+ buildingOutlineId: number;
866
+ city?: string;
867
+ country: string;
868
+ floors: IBuildingFloor[];
869
+ groundFloor: string;
870
+ isPrivate: "yes" | "no";
871
+ labelCenter: ILabelCenter;
872
+ name: IMultiLangName;
873
+ organization: string;
874
+ region: string;
875
+ signalMap: boolean;
876
+ type: string;
877
+ venueId: string;
878
+ venueName: IMultiLangName;
879
+ defaultFloor?: string;
880
+ }
881
+ export interface IEntityPoint {
882
+ type: string;
883
+ coordinates: [
884
+ number,
885
+ number
886
+ ];
887
+ }
888
+ export interface IVenueInlineBuilding {
889
+ id: string;
890
+ name: IMultiLangName;
891
+ buildingOutlineId: number;
892
+ point: IEntityPoint;
893
+ floors: IBuildingFloor[];
894
+ visualMap: boolean;
895
+ signalMap: boolean;
896
+ }
897
+ export interface IVenue {
898
+ id: string;
899
+ name: IMultiLangName;
900
+ address: IMultiLangAddress;
901
+ type: string;
902
+ venueOutlineId: number;
903
+ bbox: IBbox;
904
+ labelCenter: ILabelCenter;
905
+ point: IEntityPoint;
906
+ organization: string[];
907
+ restricted: boolean;
908
+ owner: string;
909
+ country: string;
910
+ region: string;
911
+ buildings: IVenueInlineBuilding[];
912
+ visualMap: boolean;
913
+ signalMap: boolean;
914
+ defaultBuilding?: string;
915
+ }
916
+ export interface IResponseVenues {
917
+ venues: IVenue[];
918
+ total: number;
919
+ }
920
+ export declare class VenuesService {
921
+ private _api;
922
+ private _request;
923
+ constructor();
924
+ /**
925
+ * @description Search venues by ids.
926
+ * @param ids The number of IDs cannot exceed 10.
927
+ */
928
+ searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseVenues>>;
929
+ /**
930
+ * @description Search venues by center and distance.
931
+ * @param keywords
932
+ * @param center
933
+ * @param distance Radius from center, unit is kilometers.
934
+ * @param offset The maximum value is 100, default is 10.
935
+ * @param page Default is 1.
936
+ */
937
+ searchByDistance(keywords: string, center: [
938
+ number,
939
+ number
940
+ ], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
941
+ /**
942
+ * @description Search venues in specified bbox.
943
+ * @param keywords
944
+ * @param bbox Rectangular area, [minLon, minLat, maxLon, maxLat].
945
+ * @param offset The maximum value is 100, default is 10.
946
+ * @param page Default is 1.
947
+ */
948
+ searchByBbox(keywords: string, bbox: [
949
+ number,
950
+ number,
951
+ number,
952
+ number
953
+ ], offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
954
+ /**
955
+ * @description Search venues by global.
956
+ * @param keywords
957
+ * @param offset The maximum value is 100, default is 10.
958
+ * @param page Default is 1.
959
+ */
960
+ searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseVenues>>;
961
+ }
962
+ export interface IResponseBuildings {
963
+ buildings: IBuilding[];
964
+ total: number;
965
+ }
784
966
  export declare class BuildingsService {
785
967
  private _api;
786
968
  private _request;
787
969
  constructor();
970
+ /**
971
+ * @description Search buildings by id[s].
972
+ * @param ids Single id string or id string array. The number of IDs cannot exceed 10.
973
+ */
788
974
  searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseBuildings>>;
975
+ /**
976
+ * @description Search buildings by center and distance.
977
+ * @param keywords
978
+ * @param center
979
+ * @param distance Radius from center, unit is kilometers.
980
+ * @param offset The maximum value is 100, default is 10.
981
+ * @param page Default is 1.
982
+ */
789
983
  searchByDistance(keywords: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
984
+ /**
985
+ * @description Search buildings in specified bbox.
986
+ * @param keywords
987
+ * @param bbox Rectangular area, [minLon, minLat, maxLon, maxLat].
988
+ * @param offset The maximum value is 100, default is 10.
989
+ * @param page Default is 1.
990
+ */
790
991
  searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
992
+ /**
993
+ * @description Search buildings global.
994
+ * @param keywords
995
+ * @param offset The maximum value is 100, default is 10.
996
+ * @param page Default is 1.
997
+ */
791
998
  searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
999
+ /**
1000
+ * @description Search building by floor id.
1001
+ * @param floorId
1002
+ */
1003
+ searchByFloorId(floorId: string): AxiosPromise<IResponse<IResponseBuildings>>;
792
1004
  private _changedRes;
793
1005
  }
794
1006
  export interface ILocation {
@@ -796,144 +1008,288 @@ export interface ILocation {
796
1008
  lon: number;
797
1009
  }
798
1010
  export interface IPoi {
799
- address?: string;
1011
+ accessibilityDetail: object;
800
1012
  buildingId: string;
801
- category?: string;
802
- description?: string;
803
- email?: string;
1013
+ category: string[];
804
1014
  floor: string;
1015
+ floorId: string;
805
1016
  id: string;
806
1017
  location: ILocation;
807
1018
  name: IMultiLangName;
1019
+ osmRefId: number;
1020
+ poiId: string;
1021
+ venueId: string;
1022
+ description?: string;
1023
+ email?: string;
808
1024
  openingHours?: string;
809
- osmRefId?: number;
810
1025
  phone?: string;
811
- poiId?: string;
812
1026
  website?: string;
813
1027
  }
814
1028
  export interface IResponsePois {
815
1029
  pois: IPoi[];
816
1030
  total: number;
817
1031
  }
1032
+ export interface IPoiCategory {
1033
+ category: string;
1034
+ description: string;
1035
+ id: string;
1036
+ title: Partial<Record<keyof IMultiLangName, string>>;
1037
+ }
818
1038
  export interface IOrientationPoi {
819
1039
  angle: number;
820
1040
  buildingId: string;
1041
+ category: string[];
821
1042
  distance: number;
1043
+ distanceSource: string;
822
1044
  floor: string;
1045
+ floorId: string;
1046
+ id: string;
823
1047
  location: ILocation;
824
- name: object;
1048
+ name: IMultiLangName;
1049
+ osmRefId: number;
825
1050
  poiId: string;
826
1051
  }
827
- export interface IResponseOrientationPoi {
828
- orientationPois: IOrientationPoi[];
829
- total: number;
830
- }
831
1052
  export declare class PoisService {
832
1053
  private _api;
833
1054
  private _categories;
1055
+ private _categoriesV2;
834
1056
  private _request;
835
1057
  constructor();
836
1058
  /**
837
- * Search poi by poi ids, allow multi poi id
838
- *
839
- * @param ids: string | string[]
1059
+ * @description Search POIs by id[s].
1060
+ * @param ids Single id string or id string array. The number of IDs cannot exceed 100.
840
1061
  */
841
1062
  searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponsePois>>;
842
1063
  /**
843
- * Search poi by radius distance of the center point
844
- *
845
- * @param category poi category
846
- * @param center coordinate, [lng, lat]
847
- * @param distance unit: meter, radius distance of the center point
848
- * @param offset default 10
849
- * @param page default 1
1064
+ * @description Search POIs by radius distance of the center point.
1065
+ * @param category
1066
+ * @param center
1067
+ * @param distance Radius from center, unit is meter, cannot exceed 10,000.
1068
+ * @param offset The maximum value is 100, default is 10.
1069
+ * @param page Default is 1.
850
1070
  */
851
1071
  searchByDistance(category: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
852
1072
  /**
853
- * Search poi by within bbox range
854
- *
855
- * @param keywords poi name
856
- * @param bbox within, [min_lon, min_lat, max_lon, max_lat]
857
- * @param offset default 10
858
- * @param page default 1
1073
+ * @description Search POIs in a bbox.
1074
+ * @param keywords
1075
+ * @param bbox Rectangular area, [minLon, minLat, maxLon, maxLat].
1076
+ * @param offset The maximum value is 100, default is 10.
1077
+ * @param page Default is 1.
859
1078
  */
860
1079
  searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
861
1080
  /**
862
- * Search poi by within building
863
- *
864
- * @param keywords poi name
865
- * @param buildingId within the building
866
- * @param offset default 10
867
- * @param page default 1
1081
+ * @description Search POIs of a building.
1082
+ * @param keywords
1083
+ * @param buildingId
1084
+ * @param offset The maximum value is 100, default is 10.
1085
+ * @param page Default is 1.
868
1086
  */
869
1087
  searchByBuildingId(keywords: string, buildingId: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
870
1088
  /**
871
- * Search poi category by building id or floor
872
- *
1089
+ * @description Search POI categories by building id or floor name
1090
+ * @deprecated You can use 'searchCategories' instead
873
1091
  * @param buildingId within the building
874
1092
  * @param floor option param, within floor
875
1093
  */
876
1094
  searchCategory(buildingId: string, floor?: string): AxiosPromise<IResponse<string[]>>;
877
1095
  /**
878
- * Search orientation and poi
879
- *
880
- * @param angle the angle between cellphone's orientation and the north
881
- * @param buildingId within the building
882
- * @param center the user's current position, [lon, lat]
883
- * @param distance unit: meter, radius distance of the center point
884
- * @param distanceSearchType search type default Point
885
- * @param floor within floor
886
- */
887
- searchOrientation(angle: number, buildingId: string, center: number[], distance: number, distanceSearchType: string, floor: string): AxiosPromise<IResponse<IResponseOrientationPoi>>;
1096
+ * @description Search poi categories by building id and floor id.
1097
+ * @param buildingId
1098
+ * @param floorId
1099
+ */
1100
+ searchCategories(buildingId: string, floorId?: string): AxiosPromise<IResponse<IPoiCategory[]>>;
1101
+ /**
1102
+ * @description Search orientation and poi
1103
+ * @param angle The angle between cellphone's orientation and the north.
1104
+ * @param buildingId
1105
+ * @param center User's current position, [lon, lat].
1106
+ * @param distance Radius from center, unit is meter.
1107
+ * @param distanceSearchType Search type, default is DistanceSearchType.POINT.
1108
+ * @param floorId
1109
+ */
1110
+ searchOrientation(angle: number, buildingId: string, center: number[], distance: number, distanceSearchType?: string, floorId?: string): AxiosPromise<IResponse<IOrientationPoi[]>>;
888
1111
  private _changedRes;
889
1112
  }
890
1113
  export interface IResponseRoute {
891
- hints: IRouteHints;
892
- info: IRouteInfo;
893
- paths: IRoutePaths[];
894
- }
895
- export interface IRouteHints {
896
- "visited_nodes.average": string;
897
- "visited_nodes.sum": string;
1114
+ infos: IRouteInfo | null;
1115
+ paths: IRoutePath[];
898
1116
  }
899
1117
  export interface IRouteInfo {
900
1118
  copyrights: string[];
901
1119
  took: number;
902
1120
  }
903
- export interface IRoutePaths {
904
- ascend: number;
905
- bbox: number[];
906
- descend: number;
907
- details: object;
1121
+ export interface IInstruction {
1122
+ building_id: string;
908
1123
  distance: number;
909
- instructions: any;
910
- legs: number[];
911
- points: string | FeatureCollection<LineString>;
912
- points_encoded: boolean;
913
- snapped_waypoints: string;
1124
+ floor_id: string;
1125
+ heading: number;
1126
+ interval: [
1127
+ number,
1128
+ number
1129
+ ];
1130
+ ordinal: number;
1131
+ sign: number;
1132
+ street_name: string;
1133
+ text: string;
914
1134
  time: number;
915
- transfers: number;
916
- weight: number;
1135
+ type: string | null;
1136
+ venue_id: string;
1137
+ }
1138
+ export interface IRoutePath {
1139
+ bbox: [
1140
+ number,
1141
+ number,
1142
+ number,
1143
+ number
1144
+ ];
1145
+ distance: number;
1146
+ instructions: IInstruction[];
1147
+ points: {
1148
+ coordinates: Array<[
1149
+ number,
1150
+ number
1151
+ ]>;
1152
+ type: string;
1153
+ };
1154
+ snapped_waypoints: {
1155
+ coordinates: Array<[
1156
+ number,
1157
+ number
1158
+ ]>;
1159
+ type: string;
1160
+ };
1161
+ time: number;
1162
+ }
1163
+ export declare enum WayFindingVehicleType {
1164
+ FOOT = "foot",
1165
+ WHEELCHAIR = "wheelchair",
1166
+ ESCALATOR = "escalator"
917
1167
  }
918
1168
  export declare class RouteService {
919
1169
  private _api;
920
1170
  private _request;
921
1171
  constructor();
922
1172
  /**
923
- * Search wayfinding result, support across building query
924
- *
925
- * @param fromCoord from coordinate [lng, lat] (start point)
926
- * @param toCoord to coordinate [lng, lat] (end point)
927
- * @param fromFloor from building's floor (start point)
928
- * @param toFloor to building's floor (end point)
929
- * @param fromBuildingId from building (start point)
930
- * @param toBuildingId to building (end point)
931
- * @param vehicle option param, Available values : foot, wheelchair, default foot
932
- * @param locale option param, result return language
933
- * @param toDoor option param, if end point result in the room, wayfinding result will only to the door, default `true`
934
- */
935
- search(fromCoord: number[], toCoord: number[], fromFloor: string, toFloor: string, fromBuildingId: string, toBuildingId: string, vehicle?: string, locale?: string, toDoor?: boolean): AxiosPromise<IResponse<IResponseRoute>>;
1173
+ * @description Search the route of any two points.
1174
+ * @param fromCoordinate Coordinate [lng, lat] of start point.
1175
+ * @param toCoordinate Coordinate [lng, lat] of end point.
1176
+ * @param fromFloorId {string | null}
1177
+ * @param toFloorId {string | null}
1178
+ * @param fromBuildingId {string | null}
1179
+ * @param toBuildingId {string | null}
1180
+ * @param vehicle
1181
+ * @param locale Language-specific response.
1182
+ * @param toDoor Whether the end point of the route is in the room(otherwise at the door), default is "true".
1183
+ */
1184
+ search(fromCoordinate: [
1185
+ number,
1186
+ number
1187
+ ], toCoordinate: [
1188
+ number,
1189
+ number
1190
+ ], fromFloorId: string | null, toFloorId: string | null, fromBuildingId: string | null, toBuildingId: string | null, vehicle?: WayFindingVehicleType, locale?: string, toDoor?: boolean): AxiosPromise<IResponse<IResponseRoute>>;
1191
+ }
1192
+ export declare class RoutePainter {
1193
+ private _maplibreMap;
1194
+ private _fromCoordinate;
1195
+ private _toCoordinate;
1196
+ private _fromMarkerIcon;
1197
+ private _toMarkerIcon;
1198
+ private _markerIconSize;
1199
+ private _paintProperties;
1200
+ constructor(maplibreMap: MaplibreMap);
1201
+ /**
1202
+ * @description Set image of the start marker.
1203
+ * @param icon Sprite name in map style or the image url, png format.
1204
+ */
1205
+ setFromMarkerIcon(icon: string): this;
1206
+ /**
1207
+ * @description Set image of the end marker.
1208
+ * @param icon Sprite name in map style or the image url, png format.
1209
+ */
1210
+ setToMarkerIcon(icon: string): this;
1211
+ /**
1212
+ * @description Set image icon scale.
1213
+ * @param size Default is 1.
1214
+ */
1215
+ setMarkerIconSize(size: number): this;
1216
+ /**
1217
+ * @description Set the route color of the indoor part.
1218
+ * @param color The color type is a color in the sRGB color space.
1219
+ * Formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA.
1220
+ * Predefined HTML colors names, like yellow and blue, are also permitted.
1221
+ */
1222
+ setIndoorLineColor(color: string): this;
1223
+ /**
1224
+ * @description Set the route color of the outdoor part.
1225
+ * @param color The color type is a color in the sRGB color space.
1226
+ * Formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA.
1227
+ * Predefined HTML colors names, like yellow and blue, are also permitted.
1228
+ */
1229
+ setOutdoorLineColor(color: string): this;
1230
+ /**
1231
+ * @description Set color of dashed line which connected the start and end markers.
1232
+ * @param color The color type is a color in the sRGB color space.
1233
+ * Formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA.
1234
+ * Predefined HTML colors names, like yellow and blue, are also permitted.
1235
+ */
1236
+ setDashedLineColor(color: string): this;
1237
+ /**
1238
+ * @description Set color of shuttle bus line.
1239
+ * @param color The color type is a color in the sRGB color space.
1240
+ * Formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA.
1241
+ * Predefined HTML colors names, like yellow and blue, are also permitted.
1242
+ */
1243
+ setBusLineColor(color: string): this;
1244
+ /**
1245
+ * @description Render route on the map.
1246
+ * @param path Route path from RouteService.search response.
1247
+ * @param fromCoordinate Coordinate [lng, lat] of start point.
1248
+ * @param toCoordinate Coordinate [lng, lat] of end point.
1249
+ */
1250
+ render(path: IRoutePath, fromCoordinate: [
1251
+ number,
1252
+ number
1253
+ ], toCoordinate: [
1254
+ number,
1255
+ number
1256
+ ]): this;
1257
+ /**
1258
+ * @description Remove route from the map.
1259
+ */
1260
+ remove(): this;
1261
+ /**
1262
+ * @description Filter paths' opacity by venue and ordinal.
1263
+ * @param venueId {string | null | undefined}
1264
+ * @param ordinal {string | null | undefined}
1265
+ */
1266
+ setFilterByVenue(venueId: string | null | undefined, ordinal: string | null | undefined): this;
1267
+ /**
1268
+ * @description Filter paths' opacity by building and ordinal.
1269
+ * @param buildingId {string | null | undefined}
1270
+ * @param ordinal {string | null | undefined}
1271
+ */
1272
+ setFilterByBuilding(buildingId: string | null | undefined, ordinal: string | null | undefined): this;
1273
+ private _loadImage;
1274
+ private _classifyFeatures;
1275
+ private _createLineFeature;
1276
+ private _createIconFeature;
1277
+ private _renderSolidLines;
1278
+ private _renderDashedLines;
1279
+ private _renderConnectors;
1280
+ private _renderFromToMarkers;
1281
+ private _addCollectionSource;
1282
+ private _addLineLayer;
1283
+ private _addTriangleLayer;
1284
+ private _addIconLayer;
1285
+ }
1286
+ export declare const OFFSET: number;
1287
+ export declare const PAGE: number;
1288
+ export declare enum DistanceSearchType {
1289
+ POINT = "Point",
1290
+ POLYGON = "Polygon"
936
1291
  }
937
1292
  export declare const version: string;
1293
+ export type { ControlPosition, Map as MaplibreMap, MapLayerEventType, FilterSpecification, PointLike, } from "maplibre-gl";
938
1294
 
939
1295
  export {};