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