@mapxus/mapxus-map-jp 5.4.1 → 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 +890 -564
  3. package/index.js +6 -4
  4. package/package.json +4 -18
package/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- // Generated by dts-bundle-generator v6.12.0
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,19 +12,46 @@ 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;
49
+ collapseCopyright?: boolean;
50
+ selectedBuildingBorderStyle?: ISelectedBuildingBorderStyle;
51
+ floorsControlStyle?: IFloorsControlStyle;
52
+ floorSwitchMode?: FloorSwitchMode;
27
53
  }
28
- export declare type Listener = (param: Object) => any;
54
+ export type Listener = (param: Object) => any;
29
55
  declare class DefinedEvent {
30
56
  private _type;
31
57
  private _target;
@@ -46,23 +72,17 @@ export declare class Evented {
46
72
  private _eventedParent;
47
73
  private _eventedParentData;
48
74
  /**
49
- * Adds a listener to a specified event type.
50
- *
51
- * @param {string} type The event type to add a listen for.
52
- * @param {Function} listener The function to be called when the event is fired.
53
- * The listener function is called with the data object passed to `fire`,
54
- * extended with `target` and `type` properties.
55
- * @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
56
78
  */
57
- on(type: any, listener: Listener): this;
79
+ on(type: string, listener: Listener): this;
58
80
  /**
59
- * Removes a previously registered event listener.
60
- *
61
- * @param {string} type The event type to remove listeners for.
62
- * @param {Function} listener The listener function to remove.
63
- * @returns {Object} `this`
81
+ * @description Remove a registered event listener
82
+ * @param type name of the event
83
+ * @param listener event handler
64
84
  */
65
- off(type: any, listener: Listener): this;
85
+ off(type: string, listener: Listener): this;
66
86
  /**
67
87
  * Adds a listener that will be called only once to a specified event type.
68
88
  *
@@ -90,304 +110,258 @@ export declare class Evented {
90
110
  */
91
111
  setEventedParent(parent: Evented, data?: Object | (() => Object)): this;
92
112
  }
93
- export interface IMultiLangName {
94
- default: string;
95
- en: string;
96
- "zh-Hans"?: string;
97
- "zh-Hant"?: string;
98
- ja?: string;
99
- ko?: string;
100
- }
101
- export interface IBbox {
102
- maxLat: number;
103
- maxLon: string;
104
- minLat: number;
105
- minLon: number;
106
- }
107
- export interface IBuilding {
108
- building: string;
109
- id: string;
110
- label_center: string;
111
- level_ids: string;
112
- level_names: string;
113
- name: string;
114
- "name:en": string;
115
- "name:zh-Hant": string;
116
- ordinals: string;
117
- "ref:venue": string;
118
- type: string;
119
- }
120
- export interface IFeatureBuilding extends MapGeoJSONFeature {
121
- properties: IBuilding;
122
- geometry: Polygon;
113
+ export interface IFloor {
114
+ code: string | null;
115
+ id: string | null;
116
+ ordinal: string | null;
123
117
  }
124
- export interface ISearchBuilding {
125
- address: {
126
- [key in keyof IMultiLangName]: {
127
- housenumber: string;
128
- street: string;
129
- };
130
- };
131
- bbox: IBbox;
132
- buildingId: string;
133
- buildingOutlineId: number;
134
- city?: string;
135
- country: string;
136
- floors: {
137
- code: string;
138
- id: string;
139
- ordinal: number;
140
- signalMap: boolean;
141
- visualMap: boolean;
142
- }[];
143
- groundFloor: string;
144
- isPrivate: "yes" | "no";
145
- labelCenter: {
146
- lat: number;
147
- lon: number;
148
- };
149
- name: IMultiLangName;
150
- organization: string;
151
- region: string;
152
- signalMap: boolean;
153
- type: string;
154
- venueId: string;
155
- venueName: IMultiLangName;
156
- }
157
- /**
158
- * Indoor map core logic
159
- */
160
118
  export declare class Indoor extends Evented {
161
119
  private _map;
162
120
  private _features;
163
- private _buildingFloors;
164
- private _buildingOrdinals;
165
- private _buildingFloor;
166
- private _refLevel;
167
121
  private _curBuildingId;
168
122
  private _curBuildingFeature;
123
+ private _ordinal;
124
+ private _floorId;
125
+ private _floorName;
126
+ private _buildingFloors;
127
+ private _buildingOrdinals;
169
128
  private _enableSwitch;
170
129
  private _enableSwitchBuilding;
171
130
  private _isHiddenOutdoor;
172
131
  private _indoorLayers;
173
- private _footprints;
174
132
  private _hasCustomLevelFill;
175
133
  private _curVenueId;
176
134
  private _curVenueFeature;
177
- private _curOrdinal;
178
- private _curOrdinals;
179
- private _venueFloors;
180
- private _refLevels;
181
- private _levelsMap;
182
- private _displayedLevels;
183
- private _curVenueLevelIds;
184
- private _incompleteVenues;
185
- private static isFilterHasBeenReset;
186
- private static isLevel;
187
- private static isPoi;
188
- private static getBuildingPoint;
189
- constructor(map: maplibreMap, isHiddenOutdoor?: boolean);
190
- /** Turn on the indoor and outdoor switching */
135
+ private _footprints;
136
+ private readonly _displayLevelSet;
137
+ private _curVenueLevelMap;
138
+ private _curBuildingLevelMap;
139
+ private _isSelectBuildingByClickMap;
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
+ */
191
148
  enableSwitch(): this;
192
- /** Turn off the indoor and outdoor switching */
149
+ /**
150
+ * @description Turn off indoor-outdoor switching.
151
+ */
193
152
  disableSwitch(): this;
194
- /** Turn on the buildings switching */
153
+ /**
154
+ * @description Turn on building-building switching.
155
+ */
195
156
  enableSwitchBuilding(): this;
196
- /** Turn off the buildings switching */
197
- disableSwitchBuilding(): this;
198
157
  /**
199
- * Get the selected building's levels list
200
- * @return {string[]}
158
+ * @description Turn off building-building switching.
201
159
  */
202
- get buildingFloors(): string[];
160
+ disableSwitchBuilding(): this;
203
161
  /**
204
- * Get the selected building's ordinals list
205
- * @return {string[]}
162
+ * @description Get a list of floors of the selected building
163
+ * @deprecated You can use "indoor.building" instead
164
+ * @returns {string[]}
206
165
  */
207
- get buildingOrdinals(): string[];
166
+ get floors(): string[];
208
167
  /**
209
- * Get current venue's ordinals
168
+ * @description Get the selected building's ordinal list
169
+ * @deprecated You can use "indoor.building" instead
170
+ * @return {string[]}
210
171
  */
211
172
  get ordinals(): string[];
212
173
  /**
213
- * Get the selected building's id
174
+ * @description Get the selected building's id
175
+ * @deprecated You can use "indoor.building" instead
214
176
  * @returns {string}
215
177
  */
216
178
  get buildingId(): string;
217
179
  /**
218
- * Get current floor of the selected building
219
- * @returns {string}
180
+ * @description Get current floor of the selected building
181
+ * @deprecated You should use "indoor.floor" instead
182
+ * @returns {string | null}
220
183
  */
221
- get currentFloor(): string;
184
+ get currentFloor(): string | null;
222
185
  /**
223
- * Get current ordinal of selecting venue
186
+ * @description Get current ordinal of selecting building
187
+ * @deprecated you should use "indoor.floor" instead
188
+ * @returns {string | null}
224
189
  */
225
190
  get ordinal(): string | null;
226
191
  /**
227
- * Get current venueId
192
+ * @description Get current venueId
193
+ * @deprecated You should use the new getter 'venue' instead
194
+ * @returns {string | null}
228
195
  */
229
196
  get venueId(): string | null;
230
197
  /**
231
- * Get floors of current venue
198
+ * @description Get current floor id
199
+ * @deprecated You can use "indoor.floor" instead
200
+ * @returns {string | null}
232
201
  */
233
- get venueFloors(): string[];
202
+ get floorId(): string | null;
234
203
  /**
235
- * Get referred level of selecting building
236
- * @returns {string}
204
+ * @description Get the current floor's information.
237
205
  */
238
- get refLevel(): string;
206
+ get floor(): IFloor;
239
207
  /**
240
- * Get referred levels of current venue
241
- * @return {string[]}
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}
242
215
  */
243
- get refLevels(): string[];
216
+ get venue(): MapGeoJSONFeature | null;
244
217
  /**
245
- * Get the tiles of bbox
246
- * @returns {IFeatureBuilding[]}
218
+ * @description Get the geo features of bbox.
247
219
  */
248
220
  get features(): MapGeoJSONFeature[];
249
221
  /**
250
- * Get the feature by the specified id
251
- * @param id: {string}
222
+ * @description Get specified feature of bbox by id.
223
+ * @param id
252
224
  * @return {MapGeoJSONFeature | undefined}
253
225
  */
254
226
  getFeature(id: string): MapGeoJSONFeature | undefined;
255
227
  /**
256
- * Get the building at the point
257
- * @param point: {PointLike}
258
- * @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}
259
232
  */
260
- getBuildingByPoint(point?: PointLike): IFeatureBuilding | undefined;
233
+ getBuildingByPoint(point: PointLike): MapGeoJSONFeature | null;
261
234
  /**
262
- * Select a building feature
263
- * @param feature: {IFeatureBuilding | null}
235
+ * @description Get level feature at the point
236
+ * @param point
237
+ * @return {MapGeoJSONFeature | null}
264
238
  */
265
- selectBuilding(feature?: IFeatureBuilding | null): void;
239
+ getLevelByPoint(point: PointLike): MapGeoJSONFeature | null;
266
240
  /**
267
- * Switch to the building feature
268
- * @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
269
246
  */
270
- switchBuilding(feature: IFeatureBuilding): void;
247
+ goToBuilding(buildingId: string, floorId?: string, callback?: (feature: MapGeoJSONFeature) => void): void;
271
248
  /**
272
- * Select a building and pan to the building
273
- * @param buildingId: {string}
249
+ * @description Map pan to the building center and select the building.
250
+ * @param buildingId
251
+ * @param floorId
274
252
  * @param callback
275
253
  */
276
- goToBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): void;
254
+ panToBuilding(buildingId: string, floorId?: string, callback?: (feature: MapGeoJSONFeature) => void): void;
277
255
  /**
278
- * Switch floor to filter features
279
- * @param ordinal: {string}
256
+ * @description Switch floor by ordinal
257
+ * @deprecated You should use the "switchFloorByOrdinal" instead
258
+ * @param ordinal {string}
280
259
  */
281
260
  switchFloor(ordinal: string): void;
282
261
  /**
283
- * Hide the outdoor map
284
- * @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
285
269
  */
286
270
  hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
287
- /** Update map after the style changed */
288
- updateLayers(): void;
289
- /** filter the layers */
290
- setFloorsFilter(): void;
291
- private _getConditionsExpression;
292
- private _loadData;
293
- private _init;
294
- private _load;
295
- private _clear;
296
271
  /**
297
- * 未选中 venue 其内的 building 显示 venue 历史 ordinal (或 ground ordinal)对应的楼层,如无,则空白
298
- * @private
272
+ * @description Update map layout.
299
273
  */
300
- private _initVenues;
274
+ updateLayers(): void;
301
275
  /**
302
- * Venue 缺少 building_ids 属性其下 building 显示自身最接近地面层
303
- * @private
276
+ * @description Filter indoor layers.
304
277
  */
305
- private _initLostBuildings;
278
+ setFloorsFilter(): void;
306
279
  /**
307
- * 增加需要显示的 level id(s)
308
- * @param levelIds: {string | string[]}
309
- * @private
280
+ * @description Set the style of SelectedBuildingBorder.
281
+ * @param style {ISelectedBuildingBorderStyle | null}
310
282
  */
311
- private _addDisplayedLevels;
283
+ setSelectedBuildingBorderStyle(style: ISelectedBuildingBorderStyle | null): void;
312
284
  /**
313
- * 删除显示的 level id(s)
314
- * @param levelIds: {string | string[]}
315
- * @private
285
+ * @description Listen for the indoor map state, including the changes of venue, building and floor.
286
+ * @param listener
316
287
  */
317
- private _removeDisplayedLevels;
318
- private _setCurIndoorStates;
319
- /***
320
- * 以 Map<venueId_ordinal, levelId[]> 格式保存当前 venue ordinal-level 的对应关系
321
- * 把当前 bbox 里 venue 的全部 level ids 保存到变量 "_curVenueLevelIds"
322
- * @private
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}
323
300
  */
324
- private _setLevelsCache;
301
+ selectBuilding(feature?: MapGeoJSONFeature | null, floorId?: string): void;
302
+ private _selectBuilding;
303
+ private _getBuildingByPoint;
304
+ private _getConditionsExpression;
305
+ private _loadData;
306
+ private _init;
307
+ private _load;
308
+ private _clear;
325
309
  private _updateFilter;
326
310
  private _setPoiTextColor;
327
311
  private _addTextHaloColor;
328
312
  private _getFeatures;
329
- /**
330
- * Get selecting building feature
331
- * @private
332
- */
333
- private _getFeatureInfo;
334
- /**
335
- * Get level_names 列表,指定 feature,返回 feature 的 level_names;
336
- * 无则优先 current venue level_names, 无则取 selecting building level_names.
337
- * @param feature
338
- * @return string[]
339
- * @private
340
- */
341
- private _getLevelNames;
342
- private _getBuildingId;
343
- /**
344
- * Get current building level id
345
- * @private
346
- */
347
- private _getRefLevel;
348
- /**
349
- * Get ordinals 列表, 如不传 buildingFeature 则取 venue level_ordinals.
350
- * @param buildingFeature
351
- * @private
352
- */
353
- private _getOrdinals;
354
- /**
355
- * 获取 venue 或 building 的 ordinal: 有 floor 参数则返回该 floor 对应的 ordinal;
356
- * 无则返回历史 ordinal(venue 独有) 或离地面层最近的 ordinal.
357
- * @param feature: {MapGeoJSONFeature}
358
- * @param floor?: {string}
313
+ private _getBuildingFloorByOrdinal;
314
+ private _getBuildingFloorByFloorId;
315
+ private _getBuildingFloorsAndOrdinals;
316
+ private _isNotCurrentFeature;
317
+ private _setOutdoorLayersHidden;
318
+ private _addCustomLevelFillLayer;
319
+ private _setIndoorState;
320
+ private _setBuildingHighlight;
321
+ private _addBuildingHighlightLayer;
322
+ private _filterBuildingHighlight;
323
+ private _addDisplayLevels;
324
+ private _removeDisplayLevels;
325
+ private _setDisplayLevels;
326
+ private _cacheCurVenueLevels;
327
+ private _cacheCurBuildingLevels;
328
+ /**
329
+ * @description priority: history > default_displayed_floor > ordinal equal to or closest to 0
330
+ * @param building
359
331
  * @private
360
332
  */
361
- private _getOrdinal;
333
+ private _getBuildingOrdinal;
334
+ private _getFloorIdByOrdinal;
362
335
  /**
363
- * 获取当前 building floor
336
+ * @description 判断当前 building 是否为隐藏式 building,即点击的 building 无显示元素
337
+ * @param building
364
338
  * @private
365
339
  */
366
- private _getLevelName;
367
- private _isNotCurrentFeature;
368
- private _setOutdoorLayersHidden;
369
- private _addCustomLevelFillLayer;
370
- }
371
- export interface IFloorsControlStyle {
372
- fontColor?: string;
373
- selectFontColor?: string;
374
- selectBoxColor?: string;
340
+ private _isHiddenBuilding;
341
+ private _isVenueMode;
342
+ private _getDisplayLevelsByVenueMode;
343
+ private _getDisplayLevelsByBuildingMode;
344
+ private _getUnselectedVenueOrdinal;
345
+ private _getBuildingFloor;
346
+ private static isFilterHasBeenReset;
375
347
  }
376
348
  export interface IPoiEvent {
377
- lngLat: maplibregl.LngLat;
378
- originalEvent: Event;
379
- point: PointLike;
380
- feature: Feature<GeometryObject>;
349
+ coordinate: LngLat;
350
+ poi: MapGeoJSONFeature;
351
+ building: MapGeoJSONFeature | null;
352
+ venue: MapGeoJSONFeature | null;
353
+ floor: IFloor;
381
354
  }
382
- export interface IFloorEvent {
383
- floor: string;
384
- feature: Feature<GeometryObject>;
355
+ export interface IPointEvent {
356
+ coordinate: LngLat;
357
+ point: PointLike;
385
358
  }
386
- export interface IMapClickEvent extends Event {
387
- point?: PointLike;
388
- feature?: IFeatureBuilding;
359
+ export interface IMapClickEvent {
360
+ coordinate: LngLat;
361
+ building: MapGeoJSONFeature | null;
362
+ venue: MapGeoJSONFeature | null;
363
+ floor: IFloor;
389
364
  }
390
- export declare type TPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
391
365
  export declare class Map extends Evented {
392
366
  private _map;
393
367
  private _indoor;
@@ -396,376 +370,429 @@ export declare class Map extends Evented {
396
370
  private _enableFloorControl;
397
371
  private _enableBuildingSelector;
398
372
  private _poi;
399
- private _buildingId;
400
373
  private _initialHiddenLayers;
401
374
  private _attributionControl;
402
375
  private _mapZoom;
403
376
  private _dispatch;
404
- private static _getThemeStyleName;
405
377
  constructor(option: IMapOption);
406
378
  /**
407
- * Map completely init
408
- * @param {Function} callback all map operations
379
+ * @description This function will be called once the indoor source loaded.
380
+ * @param callback
409
381
  */
410
- renderComplete(callback: (event: Event) => void): void;
382
+ renderComplete(callback: VoidFunction): void;
411
383
  /**
412
- * Get indoor information: buildingId, floors...
413
- * @returns {Indoor}
384
+ * @description Get map indoor instance.
414
385
  */
415
386
  getIndoor(): Indoor;
416
- /** Get map instance */
417
- getMap(): maplibreMap;
418
387
  /**
419
- * Convert the POI text to the specified language
420
- * @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.
421
394
  */
422
395
  transformPoiTextFieldLanguage(language: string): void;
423
- /** Turn on indoor and outdoor switching */
396
+ /**
397
+ * @description Turn on indoor-outdoor switching.
398
+ */
424
399
  enableSwitch(): this;
425
- /** Turn off indoor and outdoor switching */
400
+ /**
401
+ * @description Turn off indoor-outdoor switching.
402
+ */
426
403
  disableSwitch(): this;
427
- /** Turn on the buildings switching */
404
+ /**
405
+ * @description Turn on building-building switching.
406
+ */
428
407
  enableSwitchBuilding(): this;
429
- /** Turn off the buildings switching */
408
+ /**
409
+ * @description Turn off building-building switching.
410
+ */
430
411
  disableSwitchBuilding(): this;
431
412
  /**
432
- * To hide the outdoor map
433
- * @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.
434
416
  */
435
417
  hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
436
418
  /**
437
- * 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
438
426
  * @returns {string[]}
439
427
  */
440
428
  get floors(): string[];
441
429
  /**
442
- * Get the current floor of the selected building
443
- * @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}
444
433
  */
445
- get currentFloor(): string;
434
+ get currentFloor(): string | null;
446
435
  /**
447
- * Get the selected building properties
448
- * @returns {IBuilding | undefined}
436
+ * @description Get the current ordinal of the selected building
437
+ * @deprecated You can use "map.floor" instead
438
+ * @returns {string | null}
449
439
  */
450
- get building(): IBuilding | undefined;
440
+ get ordinal(): string | null;
441
+ /**
442
+ * @description Get venueId which the selected building belongs
443
+ * @deprecated You can use "map.venue" instead
444
+ * @returns {string | null}
445
+ */
446
+ get venueId(): string | null;
447
+ /**
448
+ * @description Get current selected floor info.
449
+ * @return {IFloor | null}
450
+ */
451
+ get floor(): IFloor | null;
451
452
  /**
452
- * Get feature by the specified id
453
- * @param id: {string}
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}
460
+ */
461
+ get venue(): MapGeoJSONFeature | null;
462
+ /**
463
+ * @description Get feature in bbox by id.
464
+ * @param id
465
+ * @return {MapGeoJSONFeature | undefined}
454
466
  */
455
467
  getFeature(id: string): MapGeoJSONFeature | undefined;
456
468
  /**
457
- * Select the building feature to enter its indoor
458
- * @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
459
472
  */
460
- selectBuilding(feature: IFeatureBuilding): this;
473
+ selectBuilding(feature: MapGeoJSONFeature | null): this;
461
474
  /**
462
- * Switch the selected building to be the specified id
463
- * @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}
464
478
  * @param callback
465
479
  */
466
- switchBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): this;
480
+ switchBuilding(buildingId: string, callback?: (feature: MapGeoJSONFeature) => void): this;
467
481
  /**
468
- * Switch to the specified floor
469
- * @param floor: {string}
482
+ * @description Switch to the specified floor
483
+ * @deprecated You can use "map.selectFloorById" instead
484
+ * @param floor {string}
470
485
  * @param callback
471
486
  */
472
- switchFloor(floor: string, callback?: (object: {
473
- floor: string;
474
- feature: IFeatureBuilding;
475
- }) => void): this;
487
+ switchFloor(floor: string, callback?: (feature: MapGeoJSONFeature) => void): this;
476
488
  /**
477
- * Listen for mouse click events on the map
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>;
494
+ /**
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.
478
508
  * @param listener
479
- * @return {unsubscribe}: to remove the event listener
480
509
  */
481
510
  onMapClickListener(listener: (event: IMapClickEvent) => void): {
482
- unsubscribe: Function;
511
+ unsubscribe: VoidFunction;
483
512
  };
484
513
  /**
485
- * Listen for the indoor POI click events
514
+ * @description Listen for mouse click events on indoor POI
486
515
  * @param listener
487
- * @return {unsubscribe}: to remove the event listener
488
516
  */
489
- onIndoorPoiListener(listener: (result: IPoiEvent) => void): {
490
- unsubscribe: Function;
517
+ onPoiClickListener(listener: (param: IPoiEvent) => void): {
518
+ unsubscribe: VoidFunction;
491
519
  };
492
520
  /**
493
- * Listen for the selected floor changed event
521
+ * @description Listen for mouse click events at a point.
494
522
  * @param listener
495
- * @return {unsubscribe}: to remove the event listener
496
523
  */
497
- onFloorChangeListener(listener: (result: IFloorEvent) => void): {
498
- unsubscribe: Function;
524
+ onPointClickListener(listener: (result: IPointEvent) => void): {
525
+ unsubscribe: VoidFunction;
499
526
  };
500
527
  /**
501
- * Listen for the selected building changed event
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
532
+ */
533
+ onFloorChangeListener(listener: (feature: MapGeoJSONFeature | null) => void): {
534
+ unsubscribe: VoidFunction;
535
+ };
536
+ /**
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.
502
556
  * @param listener
503
- * @return {unsubscribe}: to remove the event listener
504
557
  */
505
- onBuildingChangeListener(listener: (feature: IFeatureBuilding | null) => void): {
506
- unsubscribe: Function;
558
+ onMapChangeListener(listener: (params: {
559
+ venue: MapGeoJSONFeature | null;
560
+ building: MapGeoJSONFeature | null;
561
+ floor: IFloor;
562
+ }) => void): {
563
+ unsubscribe: VoidFunction;
507
564
  };
508
- /** Hide the FloorControl */
565
+ /**
566
+ * @description Hide the FloorControl.
567
+ */
509
568
  disableFloorControl(): this;
510
569
  /**
511
- * set the FloorControl enabled
512
- * @param position: TPosition
570
+ * @description Show the FloorControl.
571
+ * @param position
572
+ */
573
+ enableFloorControl(position?: ControlPosition): this;
574
+ /**
575
+ * @description Hide the BuildingSelector.
513
576
  */
514
- enableFloorControl(position?: TPosition): this;
515
- /** Hide the BuildingSelector */
516
577
  disableBuildingSelector(): this;
517
578
  /**
518
- * set the BuildingSelector enabled
519
- * @param position: TPosition
579
+ * @description Show the BuildingSelector.
580
+ * @param position
520
581
  */
521
- enableBuildingSelector(position?: TPosition): this;
582
+ enableBuildingSelector(position?: ControlPosition): this;
522
583
  /**
523
- * switch the map style
524
- * @param theme: {string}
584
+ * @description Switch the map style
585
+ * @param theme ThemeType | string(customized map style file name)
525
586
  */
526
587
  switchTheme(theme: string): void;
527
588
  /**
528
- * set the floorsControl's style
529
- * @param style: {IFloorsControlStyle}
589
+ * @description Set the floorsControl's style.
590
+ * @param style
530
591
  */
531
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;
532
599
  private _setIndoorFilter;
533
600
  private _setStyle;
534
601
  private _addControl;
535
602
  private _defaultSetMapZoom;
536
- private _defaultSelectedBuilding;
537
- private _defaultSelectedPoi;
538
- }
539
- export declare type TCoordinates = [
540
- number,
541
- number
542
- ] | [
543
- number,
544
- number
545
- ][];
546
- /**
547
- * Map marker
548
- * support all browser event
549
- * support floor and building switch
550
- * allow to define icon and scale
551
- */
552
- export declare class Marker extends Evented {
553
- 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 {
554
609
  private _maplibreMap;
555
- private _coordinates;
556
- private _floor;
557
- private _buildingId;
558
- private readonly _sourceId;
559
610
  private readonly _layerId;
611
+ private readonly _sourceId;
560
612
  private _imageName;
561
- private _imageUrl;
562
- private _imageScale;
613
+ private _imageSize;
614
+ private _iconAnchor;
615
+ constructor(maplibreMap: MaplibreMap);
563
616
  /**
564
- * Determine whether the coordinates are multi array
565
- *
566
- * @private
567
- * @returns {boolean}
617
+ * @description Set marker by sprite name.
618
+ * @param imageName Icon sprite name in map style.
568
619
  */
569
- private static isMultiArray;
570
- constructor(map?: Map);
620
+ setIconImage(imageName: string): void;
571
621
  /**
572
- * @deprecated This method should not be used
573
- * @param map
622
+ * @description Set marker by image url.
623
+ * @param imageUrl Network url, png format.
574
624
  */
575
- addTo(map: Map): this;
625
+ setIconImageUrl(imageUrl: string): void;
576
626
  /**
577
- * Set up marker handle event
578
- *
579
- * @public
580
- * @param {string} type browser event type, eq. click、dbclick、mouseenter
581
- * @param {function} callback marker event callback
627
+ * @description Set marker image size.
628
+ * @param imageScale Default is 1.
582
629
  */
583
- onEventListener(type: string, callback: (ev: MapMouseEvent) => void): void;
630
+ setIconSize(imageScale: number): void;
584
631
  /**
585
- * Create marker content, must have coordinates
586
- * Markers with the same building and floor can be appended by this function
587
- * @public
588
- * @param {number[] | number[][]} coordinates normal array is single point, two-dimensional array is multi points
589
- * @param {string} floor optional, binding the marker floor, showing markers by floor
590
- * @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
591
634
  */
592
- create(coordinates: TCoordinates, floor?: string, buildingId?: string): this;
635
+ setIconAnchor(anchor: TAnchorPosition): void;
593
636
  /**
594
- * Remove marker data
595
- * no data that will be hidden
596
- *
597
- * @public
637
+ * @description Marker layer id getter.
598
638
  */
599
- remove(): this;
639
+ get layerId(): string;
600
640
  /**
601
- * @deprecated This method should not be used
602
- * @param floor
603
- * @param buildingId
641
+ * @description Marker source id getter.
604
642
  */
605
- switch(floor: string, buildingId: string): this;
643
+ get sourceId(): string;
606
644
  /**
607
- * Get marker layer id value
608
- *
609
- * @public
610
- * @returns {string}
645
+ * @description Create marker[s] source and layer.
646
+ * @param array Coordinate and properties arrays of marker[s].
611
647
  */
612
- get layerId(): string;
648
+ create(array: Array<{
649
+ lngLat: [
650
+ number,
651
+ number
652
+ ];
653
+ properties?: {
654
+ [k: string]: string;
655
+ };
656
+ }>): void;
613
657
  /**
614
- * Get marker source id value
615
- *
616
- * @public
617
- * @returns {string}
658
+ * @description Remove marker[s] layer and source.
618
659
  */
619
- get sourceId(): string;
660
+ remove(): void;
620
661
  /**
621
- * Setup define marker icon network url
622
- *
623
- * @public
624
- * @param {string} imageUrl network url, allow format is png、gif、jpg
662
+ * @description Add marker event listener.
663
+ * @param eventKey
664
+ * @param callback
625
665
  */
626
- setImageUrl(imageUrl: string): this;
666
+ onEventListener(eventKey: keyof MapLayerEventType, callback: (marker: GeoJSONFeature) => void): void;
627
667
  /**
628
- * Setup define marker icon scale
629
- *
630
- * @public
631
- * @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/
632
672
  */
633
- setImageScale(imageScale: number): this;
634
- private _bindEvents;
673
+ setFilter(filterExpression: FilterSpecification): void;
635
674
  /**
636
- * Create marker data, contain source and layer
637
- * 1. create source
638
- * 2. create layer
639
- *
640
- * @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}
641
681
  */
642
- private _createData;
682
+ setFilterByVenue(venueId: string | null | undefined, ordinal: string | null | undefined): void;
643
683
  /**
644
- * Load and set the marker icon.
645
- *
646
- * @private
647
- * @param url
648
- * @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}
649
690
  */
650
- private _loadImage;
691
+ setFilterByBuilding(buildingId: string | null | undefined, ordinal: string | null | undefined): void;
651
692
  /**
652
- * Add marker data source, contain marker properties
653
- *
654
- * @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/
655
697
  */
656
- private _addSource;
698
+ setOpacity(filterExpression: FilterSpecification): void;
657
699
  /**
658
- * Add marker data layer, contain marker style
659
- *
660
- * @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}
706
+ */
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}
661
715
  */
662
- private _addLayer;
663
- private _setFilter;
716
+ setOpacityByBuilding(buildingId: string | null | undefined, ordinal: string | null | undefined): void;
717
+ private _createIconFeature;
718
+ private _addIconSource;
719
+ private _addIconLayer;
664
720
  }
665
721
  export declare class Poi {
666
722
  private _map;
667
- private _layers;
723
+ private _layerIds;
668
724
  private _dispatch;
669
- constructor(map: maplibregl.Map);
725
+ constructor(map: MaplibreMap);
670
726
  /**
671
- * Listen for the POI clicked event
727
+ * @description Listen for POI click events.
672
728
  * @param listener
673
- * @return {unsubscribe}: to remove the event listener
674
729
  */
675
- onPointClick(listener: (result: IPoiEvent) => void): {
676
- unsubscribe: Function;
730
+ onPoiClick(listener: (param: IPoiEvent) => void): {
731
+ unsubscribe: VoidFunction;
677
732
  };
678
- /**
679
- * Init the data after the style data is loaded
680
- * @private
681
- */
682
- private _loadData;
683
- /**
684
- * 1. Get layer id is match `poi` name data
685
- * 2. Init map on-click event
686
- *
687
- * @private
688
- */
733
+ private _bindEvents;
689
734
  private _init;
690
- /**
691
- * Map on-click poi event
692
- * if have poiClickFunction callback
693
- * and then return the poi data to callback function
694
- *
695
- * @private
696
- */
697
- private _initClick;
735
+ private _initPoiClick;
736
+ private _getFloorDataByFloorId;
698
737
  }
699
738
  export declare class FloorsControl implements IControl {
700
- private _map;
701
- private _$container;
739
+ private _container;
702
740
  private _indoor;
703
- private _$layout;
704
- private _$outer;
705
- private _$inner;
706
- private _$arrowUp;
707
- private _$arrowDown;
708
- private _floor;
709
- private _venueId;
710
- private _ordinal;
711
- private _fontColor;
712
- private _selectFontColor;
713
- private _selectBoxColor;
714
- private _$currentButton;
715
- private _$floorControlButtons;
716
- private _enableFloorControl;
717
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;
718
755
  private _dispatch;
719
- private static _$createFloor;
720
- constructor(map: Map, position?: TPosition);
721
- get position(): TPosition;
722
- get enabled(): boolean;
723
- onAdd(map: maplibreMap): HTMLElement;
756
+ private _componentDidMount;
757
+ private _isShown;
758
+ constructor(indoor: Indoor);
759
+ onAdd(): HTMLElement;
724
760
  onRemove(): void;
725
- switchBuildingFloor(floor: string, callback?: (object: IFloorEvent) => void): void;
726
- onFloorClick(listener: (result: IFloorEvent) => void): {
727
- unsubscribe: Function;
728
- };
729
- switchFloor(ordinal: string, callback?: (object: IFloorEvent) => void): void;
730
- setStyle(style: IFloorsControlStyle): void;
731
- setLayoutHidden(isHidden: boolean): void;
732
- moveFloorControl(from: TPosition, to: TPosition): void;
733
- private _listener;
761
+ getDefaultPosition(): ControlPosition;
734
762
  /**
735
- * Triggered when the user on-click on the building
736
- * 1. click current building
737
- * 2. click other building (new building)
738
- * @param event {IBuildingSelectEvent}
763
+ * @deprecated Use 'switchByOrdinal' instead
739
764
  */
740
- 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;
741
770
  /**
742
- * Triggered when the user move end on the map
771
+ * @deprecated
772
+ * @param listener
743
773
  */
744
- private _refresh;
745
- private _$createLayout;
746
- private _$configLayoutHeight;
747
- private _$configArrowDownTop;
748
- private _$showOrHideArrow;
749
- private _$showLayout;
750
- private _$hideLayout;
751
- private _$showArrowUp;
752
- private _$hideArrowUp;
753
- private _$showArrowDown;
754
- 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;
755
787
  private _$createFloors;
756
- private _$clearFloors;
757
- private _isEmptyFloors;
758
- private _isOverflowFloorMax;
759
- private _isEnableDisplay;
760
- private _scrollToClickedFloor;
761
- private _setCurrentButtonActive;
762
- private _floorClick;
763
- private _floorScroll;
764
- private _floorClickEvent;
765
- private _floorScrollEvent;
766
- private _bindEvent;
767
- private _getCurrentFloor;
768
- 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;
769
796
  }
770
797
  export declare class BuildingFilterControl implements maplibregl.IControl {
771
798
  private _map;
@@ -777,19 +804,18 @@ export declare class BuildingFilterControl implements maplibregl.IControl {
777
804
  private _buildingNameList;
778
805
  private _enableBuildingSelector;
779
806
  private readonly _position;
780
- constructor(map: Map, position?: TPosition);
807
+ constructor(map: Map, position?: ControlPosition);
781
808
  onAdd(map: MaplibreMap): HTMLElement;
782
809
  onRemove(): void;
783
- get position(): TPosition;
810
+ get position(): ControlPosition;
784
811
  get enabled(): boolean;
785
812
  setLayoutHidden(isHidden: boolean): void;
786
- moveBuildingFilter(from: TPosition, to: TPosition): void;
813
+ moveBuildingFilter(from: ControlPosition, to: ControlPosition): void;
787
814
  private _loadData;
788
815
  private _init;
789
816
  private _refresh;
790
817
  private _select;
791
818
  private _load;
792
- private _getFeatureByName;
793
819
  private _buildingFilterIconCreate;
794
820
  private _buildingNameListCreate;
795
821
  private _buildingNameListUpdate;
@@ -802,23 +828,179 @@ export declare class BuildingFilterControl implements maplibregl.IControl {
802
828
  private _$showLayout;
803
829
  private _$hideLayout;
804
830
  }
805
- export interface IResponseBuildings {
806
- buildings: ISearchBuilding[];
807
- total: number;
808
- }
809
831
  export interface IResponse<T> {
810
832
  code: number;
811
833
  message: string;
812
834
  result: T;
813
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
+ }
814
966
  export declare class BuildingsService {
815
967
  private _api;
816
968
  private _request;
817
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
+ */
818
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
+ */
819
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
+ */
820
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
+ */
821
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>>;
822
1004
  private _changedRes;
823
1005
  }
824
1006
  export interface ILocation {
@@ -826,144 +1008,288 @@ export interface ILocation {
826
1008
  lon: number;
827
1009
  }
828
1010
  export interface IPoi {
829
- address?: string;
1011
+ accessibilityDetail: object;
830
1012
  buildingId: string;
831
- category?: string;
832
- description?: string;
833
- email?: string;
1013
+ category: string[];
834
1014
  floor: string;
1015
+ floorId: string;
835
1016
  id: string;
836
1017
  location: ILocation;
837
1018
  name: IMultiLangName;
1019
+ osmRefId: number;
1020
+ poiId: string;
1021
+ venueId: string;
1022
+ description?: string;
1023
+ email?: string;
838
1024
  openingHours?: string;
839
- osmRefId?: number;
840
1025
  phone?: string;
841
- poiId?: string;
842
1026
  website?: string;
843
1027
  }
844
1028
  export interface IResponsePois {
845
1029
  pois: IPoi[];
846
1030
  total: number;
847
1031
  }
1032
+ export interface IPoiCategory {
1033
+ category: string;
1034
+ description: string;
1035
+ id: string;
1036
+ title: Partial<Record<keyof IMultiLangName, string>>;
1037
+ }
848
1038
  export interface IOrientationPoi {
849
1039
  angle: number;
850
1040
  buildingId: string;
1041
+ category: string[];
851
1042
  distance: number;
1043
+ distanceSource: string;
852
1044
  floor: string;
1045
+ floorId: string;
1046
+ id: string;
853
1047
  location: ILocation;
854
- name: object;
1048
+ name: IMultiLangName;
1049
+ osmRefId: number;
855
1050
  poiId: string;
856
1051
  }
857
- export interface IResponseOrientationPoi {
858
- orientationPois: IOrientationPoi[];
859
- total: number;
860
- }
861
1052
  export declare class PoisService {
862
1053
  private _api;
863
1054
  private _categories;
1055
+ private _categoriesV2;
864
1056
  private _request;
865
1057
  constructor();
866
1058
  /**
867
- * Search poi by poi ids, allow multi poi id
868
- *
869
- * @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.
870
1061
  */
871
1062
  searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponsePois>>;
872
1063
  /**
873
- * Search poi by radius distance of the center point
874
- *
875
- * @param category poi category
876
- * @param center coordinate, [lng, lat]
877
- * @param distance unit: meter, radius distance of the center point
878
- * @param offset default 10
879
- * @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.
880
1070
  */
881
1071
  searchByDistance(category: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
882
1072
  /**
883
- * Search poi by within bbox range
884
- *
885
- * @param keywords poi name
886
- * @param bbox within, [min_lon, min_lat, max_lon, max_lat]
887
- * @param offset default 10
888
- * @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.
889
1078
  */
890
1079
  searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
891
1080
  /**
892
- * Search poi by within building
893
- *
894
- * @param keywords poi name
895
- * @param buildingId within the building
896
- * @param offset default 10
897
- * @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.
898
1086
  */
899
1087
  searchByBuildingId(keywords: string, buildingId: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
900
1088
  /**
901
- * Search poi category by within building
902
- *
1089
+ * @description Search POI categories by building id or floor name
1090
+ * @deprecated You can use 'searchCategories' instead
903
1091
  * @param buildingId within the building
904
1092
  * @param floor option param, within floor
905
1093
  */
906
1094
  searchCategory(buildingId: string, floor?: string): AxiosPromise<IResponse<string[]>>;
907
1095
  /**
908
- * Search orientation and poi
909
- *
910
- * @param angle the angle between cellphone's orientation and the north
911
- * @param buildingId within the building
912
- * @param center the user's current position, [lon, lat]
913
- * @param distance unit: meter, radius distance of the center point
914
- * @param distanceSearchType search type default Point
915
- * @param floor within floor
916
- */
917
- 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[]>>;
918
1111
  private _changedRes;
919
1112
  }
920
1113
  export interface IResponseRoute {
921
- hints: IRouteHints;
922
- info: IRouteInfo;
923
- paths: IRoutePaths[];
924
- }
925
- export interface IRouteHints {
926
- "visited_nodes.average": string;
927
- "visited_nodes.sum": string;
1114
+ infos: IRouteInfo | null;
1115
+ paths: IRoutePath[];
928
1116
  }
929
1117
  export interface IRouteInfo {
930
1118
  copyrights: string[];
931
1119
  took: number;
932
1120
  }
933
- export interface IRoutePaths {
934
- ascend: number;
935
- bbox: number[];
936
- descend: number;
937
- details: object;
1121
+ export interface IInstruction {
1122
+ building_id: string;
938
1123
  distance: number;
939
- instructions: any;
940
- legs: number[];
941
- points: string | FeatureCollection<LineString>;
942
- points_encoded: boolean;
943
- 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;
944
1134
  time: number;
945
- transfers: number;
946
- 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"
947
1167
  }
948
1168
  export declare class RouteService {
949
1169
  private _api;
950
1170
  private _request;
951
1171
  constructor();
952
1172
  /**
953
- * Search wayfinding result, support across building query
954
- *
955
- * @param fromCoord from coordinate [lng, lat] (start point)
956
- * @param toCoord to coordinate [lng, lat] (end point)
957
- * @param fromFloor from building's floor (start point)
958
- * @param toFloor to building's floor (end point)
959
- * @param fromBuildingId from building (start point)
960
- * @param toBuildingId to building (end point)
961
- * @param vehicle option param, Available values : foot, wheelchair, default foot
962
- * @param locale option param, result return language
963
- * @param toDoor option param, if end point result in the room, wayfinding result will only to the door, default `true`
964
- */
965
- 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"
966
1291
  }
967
1292
  export declare const version: string;
1293
+ export type { ControlPosition, Map as MaplibreMap, MapLayerEventType, FilterSpecification, PointLike, } from "maplibre-gl";
968
1294
 
969
1295
  export {};