@mapxus/mapxus-map-jp 5.2.0 → 5.3.0-jp

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,439 +1,963 @@
1
- /// <reference types="mapbox-gl" />
2
- /// <reference types="geojson" />
3
- /// <reference types="./typings/axios" />
4
-
5
- export = MapxusMap;
6
-
7
- declare namespace MapxusMap {
8
- /**
9
- * Map
10
- */
11
- export class Map extends Evented {
12
- constructor(option: IMapOption);
13
-
14
- renderComplete(callback: Function): void;
15
-
16
- getIndoor(): Indoor;
17
-
18
- getMap(): mapboxgl.Map;
19
-
20
- transformPoiTextFieldLanguage(lanaguage: string): void;
21
-
22
- enableSwitch(): Map;
23
-
24
- disableSwitch(): Map;
25
-
26
- enableSwitchBuilding(): Map;
27
-
28
- disableSwitchBuilding(): Map;
29
-
30
- hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
31
-
32
- floors(): string[];
33
-
34
- currentFloor(): string;
35
-
36
- building(): IBuilding;
37
-
38
- getFeature(id: string): GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>;
39
-
40
- selectBuilding(
41
- feature: GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>
42
- ): Map;
43
-
44
- switchBuilding(buildingId: string, callback?: Function): Map;
45
-
46
- switchFloor(floor: string, callback?: Function): Map;
47
-
48
- onMapClickListener(listener: Function): Map;
49
-
50
- onIndoorPoiListener(listener: Function): Map;
51
-
52
- onFloorChangeListener(listener: Function): Map;
53
-
54
- onBuildingChangeListener(listener: Function): Map;
55
-
56
- disableFloorControl(): Map;
57
-
58
- enableFloorControl(
59
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
60
- ): Map;
61
-
62
- disableBuildingSelector(): Map;
63
-
64
- enableBuildingSelector(
65
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
66
- ): Map;
67
-
68
- switchTheme(theme: string): void;
69
- }
70
-
71
- /**
72
- * Indoor
73
- */
74
- export class Indoor extends Evented {
75
- constructor(map: mapboxgl.Map, isHiddenOutdoor?: boolean);
76
-
77
- enableSwitch(): Indoor;
78
-
79
- disableSwitch(): Indoor;
80
-
81
- enableSwitchBuilding(): Indoor;
82
-
83
- disableSwitchBuilding(): Indoor;
84
-
85
- floors(): string[];
86
-
87
- groundFloor(): string;
88
-
89
- buildingId(): string;
90
-
91
- currentFloor(): string;
92
-
93
- features(): GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>[];
94
-
95
- getFeature(id?: string): GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>;
96
-
97
- getBuildingByPoint(
98
- point: mapboxgl.PointLike
99
- ): GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>;
100
-
101
- selectBuilding(
102
- feature: GeoJSON.Feature<GeoJSON.GeometryObject, IBuilding>
103
- ): void;
104
-
105
- switchBuilding(
106
- feature: GeoJSON.Feature<
107
- GeoJSON.GeometryObject | GeoJSON.Polygon,
108
- IBuilding
109
- >
110
- ): void;
111
-
112
- goToBuilding(buildingId: string, callback?: Function): void;
113
-
114
- switchFloor(floor: string): void;
115
-
116
- initLayer(): void;
117
-
118
- hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
119
- }
120
-
121
- export class Marker extends Evented {
122
- constructor(map?: Map);
123
-
124
- onEventListener(type: string, callback: Function): void;
125
-
126
- addTo(map: Map): Marker;
127
-
128
- create(
129
- coordinates: number[] | number[][],
130
- floor?: string,
131
- buildingId?: string
132
- ): Marker;
133
-
134
- remove(): Marker;
135
-
136
- switch(floor: string): Marker;
137
-
138
- layerId(): string;
139
-
140
- setImageUrl(imageUrl: string): Marker;
141
-
142
- setImageScale(imageScale: number): Marker;
143
- }
144
-
145
- export class Poi {
146
- constructor(map: mapboxgl.Map);
147
-
148
- pointClickFunction(listener: Function): void;
149
- }
150
-
151
- export class FloorsControl implements mapboxgl.IControl {
152
- setMap(map: Map): void;
153
-
154
- onAdd(map: mapboxgl.Map): HTMLElement;
155
-
156
- onRemove(): void;
157
-
158
- getDefaultPosition(): string;
159
-
160
- floorClickFunction(listener: Function): void;
161
-
162
- switchFloor(floor: string, callback?: Function): void;
163
- }
164
-
165
- export class BuildingFilterControl implements mapboxgl.IControl {
166
- setMap(map: Map): void;
167
-
168
- setPosition(position: string | string[]): void;
169
-
170
- onAdd(map: mapboxgl.Map): HTMLElement;
171
-
172
- onRemove(): void;
173
-
174
- getDefaultPosition(): string;
175
- }
176
-
177
- export class BuildingsService {
178
- constructor();
179
-
180
- searchByIds(
181
- ...id: string[]
182
- ): AxiosType.AxiosPromise<IResponse<IResponseBuildings>>;
183
-
184
- searchByDistance(
185
- keywords: string,
186
- center: number[],
187
- distance: number,
188
- offset: number,
189
- page: number
190
- ): AxiosType.AxiosPromise<IResponse<IResponseBuildings>>;
191
-
192
- searchByBbox(
193
- keywords: string,
194
- bbox: number[],
195
- offset: number,
196
- page: number
197
- ): AxiosType.AxiosPromise<IResponse<IResponseBuildings>>;
198
-
199
- searchByGlobal(
200
- keywords: string,
201
- offset: number,
202
- page: number
203
- ): AxiosType.AxiosPromise<IResponse<IResponseBuildings>>;
204
- }
205
-
206
- export class PoisService {
207
- constructor();
208
-
209
- searchByIds(id: string[]): AxiosType.AxiosPromise<IResponse<IResponsePois>>;
210
-
211
- searchByDistance(
212
- keywords: string,
213
- center: number[],
214
- distance: number,
215
- offset: number,
216
- page: number
217
- ): AxiosType.AxiosPromise<IResponse<IResponsePois>>;
218
-
219
- searchByBbox(
220
- keywords: string,
221
- bbox: number[],
222
- offset: number,
223
- page: number
224
- ): AxiosType.AxiosPromise<IResponse<IResponsePois>>;
225
-
226
- searchByBuildingId(
227
- keywords: string,
228
- buildingId: string,
229
- offset: number,
230
- page: number
231
- ): AxiosType.AxiosPromise<IResponse<IResponsePois>>;
232
-
233
- searchCategory(
234
- buildingId: string,
235
- floor?: string
236
- ): AxiosType.AxiosPromise<IResponse<string[]>>;
237
-
238
- searchOrientation(
239
- angle: number,
240
- buildingId: string,
241
- center: number[],
242
- distance: number,
243
- distanceSearchType: string,
244
- floor: string
245
- ): AxiosType.AxiosPromise<IResponse<IResponseOrientationPoi>>;
246
- }
247
-
248
- export class RouteService {
249
- constructor();
250
-
251
- search(
252
- fromCoord: number[],
253
- toCoord: number[],
254
- fromFloor: string,
255
- toFloor: string,
256
- fromBuildingId: string,
257
- toBuildingId: string,
258
- vehicle: string,
259
- locale?: string,
260
- toDoor?: boolean
261
- ): AxiosType.AxiosPromise<IResponse<IResponseRoute>>;
262
- }
263
-
264
- /**
265
- * Evented
266
- */
267
- export class Evented {
268
- on(type: string, listener: Function): this;
269
-
270
- off(type?: string | any, listener?: Function): this;
271
-
272
- once(type: string, listener: Function): this;
273
-
274
- fire(type: string, properties?: { [key: string]: any }): this;
275
- }
276
-
277
- export interface IMapOption {
278
- // mapbox instance
279
- map: mapboxgl.Map;
280
-
281
- appId: string;
282
-
283
- secret: string;
284
-
285
- enableFloorControl?: boolean;
286
-
287
- enableBuildingSelector?: boolean;
288
- // if specify buildingId, mapbox center and zoom would invalid
289
- buildingId?: string;
290
- // must dependent on buildingId
291
- floor?: string;
292
-
293
- poiId?: string;
294
-
295
- hiddenOutdoor?: boolean;
296
-
297
- theme?: ThemeType;
298
- }
299
-
300
- export interface IBuilding {
301
- building: string;
302
-
303
- fids?: string;
304
-
305
- floors: string;
306
-
307
- ground_floor: string;
308
-
309
- id: string;
310
-
311
- name: string;
312
-
313
- type: string;
314
-
315
- labelCenter?: ILocation;
316
- }
317
-
318
- export interface IPoi {
319
- address?: string;
320
-
321
- buildingId: string;
322
-
323
- category?: string;
324
-
325
- description?: string;
326
-
327
- email?: string;
328
-
329
- floor: string;
330
-
331
- id: string;
332
-
333
- location: ILocation;
334
-
335
- name: object;
336
-
337
- openingHours?: string;
338
-
339
- osmRefId?: number;
340
-
341
- phone?: string;
342
-
343
- poiId?: string;
344
-
345
- website?: string;
346
- }
347
-
348
- export interface ILocation {
349
- lat: number;
350
-
351
- lon: number;
352
- }
353
-
354
- export interface IResponse<T> {
355
- code: number;
356
-
357
- message: string;
358
-
359
- result: T;
360
- }
361
-
362
- export interface IResponseBuildings {
363
- buildings: IBuilding[];
364
-
365
- total: number;
366
- }
367
-
368
- export interface IResponsePois {
369
- pois: IPoi[];
370
-
371
- total: number;
372
- }
373
-
374
- export interface IResponseRoute {
375
- hints: IRouteHints;
376
- info: IRouteInfo;
377
- paths: IRoutePaths[];
378
- }
379
-
380
- interface IRouteHints {
381
- 'visited_nodes.average': string;
382
- 'visited_nodes.sum': string;
383
- }
384
-
385
- interface IRouteInfo {
386
- copyrights: string[];
387
- took: number;
388
- }
389
-
390
- interface IOrientationPoi {
391
- angle: number;
392
- buildingId: string;
393
- distance: number;
394
- floor: string;
395
- location: ILocation;
396
- name: object;
397
- poiId: string;
398
- }
399
-
400
- interface IResponseOrientationPoi {
401
- orientationPois: IOrientationPoi[];
402
- total: number;
403
- }
404
-
405
- export interface IRoutePaths {
406
- ascend: number;
407
- bbox: number[];
408
- descend: number;
409
- details: object;
410
- distance: number;
411
- instructions: any;
412
- legs: number[];
413
- points: string | GeoJSON.FeatureCollection<GeoJSON.LineString>;
414
- points_encoded: boolean;
415
- snapped_waypoints: string;
416
- time: number;
417
- transfers: number;
418
- weight: number;
419
- }
420
-
421
- export enum DistanceSearchType {
422
- POINT = 'Point',
423
- POLYGON = 'Polygon'
424
- }
425
-
426
- export enum ThemeType {
427
- CHRISTMAS = 'christmas',
428
- HALLOWEEN = 'halloween',
429
- MAPPY_BEE = 'mappyBee',
430
- MAPXUS = 'mapxus',
431
- LANDS_D = 'landsD',
432
- COMMON = 'common'
433
- }
434
-
435
- export enum WayFidingVehicleType {
436
- FOOT = 'foot',
437
- WHEELCHAIR = 'wheelchair'
438
- }
439
- }
1
+ // Generated by dts-bundle-generator v6.12.0
2
+
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';
6
+
7
+ declare enum ThemeType {
8
+ CHRISTMAS = "christmas",
9
+ HALLOWEEN = "halloween",
10
+ MAPPY_BEE = "mappyBee",
11
+ MAPXUS = "mapxus",
12
+ LANDS_D = "landsD",
13
+ COMMON = "common",
14
+ MAPXUS_V2 = "mapxus_v2"
15
+ }
16
+ export interface IMapOption {
17
+ map: maplibregl.Map;
18
+ appId: string;
19
+ secret: string;
20
+ enableFloorControl?: boolean;
21
+ enableBuildingSelector?: boolean;
22
+ buildingId?: string;
23
+ floor?: string;
24
+ poiId?: string;
25
+ hiddenOutdoor?: boolean;
26
+ theme?: ThemeType;
27
+ }
28
+ export declare type Listener = (param: Object) => any;
29
+ declare class DefinedEvent {
30
+ private _type;
31
+ private _target;
32
+ constructor(type: string, data?: Object);
33
+ get type(): string;
34
+ set type(type: string);
35
+ get target(): Evented;
36
+ set target(target: Evented);
37
+ }
38
+ /**
39
+ * Methods mixed in to other classes for event capabilities.
40
+ *
41
+ * @mixin Evented
42
+ */
43
+ export declare class Evented {
44
+ private _listeners;
45
+ private _oneTimeListeners;
46
+ private _eventedParent;
47
+ private _eventedParentData;
48
+ /**
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`
56
+ */
57
+ on(type: any, listener: Listener): this;
58
+ /**
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`
64
+ */
65
+ off(type: any, listener: Listener): this;
66
+ /**
67
+ * Adds a listener that will be called only once to a specified event type.
68
+ *
69
+ * The listener will be called first time the event fires after the listener is registered.
70
+ *
71
+ * @param {string} type The event type to listen for.
72
+ * @param {Function} listener The function to be called when the event is fired the first time.
73
+ * @returns {Object} `this`
74
+ */
75
+ once(type: string, listener: Listener): this;
76
+ fire(event: DefinedEvent): this;
77
+ /**
78
+ * Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
79
+ *
80
+ * @param {string} type The event type
81
+ * @returns {boolean} `true` if there is at least one registered listener for specified event type, `false` otherwise
82
+ * @private
83
+ */
84
+ listens(type: string): boolean;
85
+ /**
86
+ * Bubble all events fired by this instance of Evented to this parent instance of Evented.
87
+ *
88
+ * @returns {Object} `this`
89
+ * @private
90
+ */
91
+ setEventedParent(parent: Evented, data?: Object | (() => Object)): this;
92
+ }
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;
123
+ }
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
+ export declare class Indoor extends Evented {
161
+ private _map;
162
+ private _features;
163
+ private _buildingFloors;
164
+ private _buildingFloor;
165
+ private _refLevel;
166
+ private _curBuildingId;
167
+ private _curBuildingFeature;
168
+ private _enableSwitch;
169
+ private _enableSwitchBuilding;
170
+ private _isHiddenOutdoor;
171
+ private _indoorLayers;
172
+ private _footprints;
173
+ private _hasCustomLevelFill;
174
+ private _curVenueId;
175
+ private _curVenueFeature;
176
+ private _curOrdinal;
177
+ private _curOrdinals;
178
+ private _venueFloors;
179
+ private _refLevels;
180
+ private _levelsMap;
181
+ private _displayedLevels;
182
+ private _curVenueLevelIds;
183
+ private _incompleteVenues;
184
+ private static isFilterHasBeenReset;
185
+ private static isLevel;
186
+ private static isPoi;
187
+ private static getBuildingPoint;
188
+ constructor(map: maplibreMap, isHiddenOutdoor?: boolean);
189
+ /** Turn on the indoor and outdoor switching */
190
+ enableSwitch(): this;
191
+ /** Turn off the indoor and outdoor switching */
192
+ disableSwitch(): this;
193
+ /** Turn on the buildings switching */
194
+ enableSwitchBuilding(): this;
195
+ /** Turn off the buildings switching */
196
+ disableSwitchBuilding(): this;
197
+ /**
198
+ * Get the selected building's levels list
199
+ * @return {string[]}
200
+ */
201
+ get buildingFloors(): string[];
202
+ /**
203
+ * Get current venue's ordinals
204
+ */
205
+ get ordinals(): string[];
206
+ /**
207
+ * Get the selected building's id
208
+ * @returns {string}
209
+ */
210
+ get buildingId(): string;
211
+ /**
212
+ * Get current floor of the selected building
213
+ * @returns {string}
214
+ */
215
+ get currentFloor(): string;
216
+ /**
217
+ * Get current ordinal of selecting venue
218
+ */
219
+ get ordinal(): string | null;
220
+ /**
221
+ * Get current venueId
222
+ */
223
+ get venueId(): string | null;
224
+ /**
225
+ * Get floors of current venue
226
+ */
227
+ get venueFloors(): string[];
228
+ /**
229
+ * Get referred level of selecting building
230
+ * @returns {string}
231
+ */
232
+ get refLevel(): string;
233
+ /**
234
+ * Get referred levels of current venue
235
+ * @return {string[]}
236
+ */
237
+ get refLevels(): string[];
238
+ /**
239
+ * Get the tiles of bbox
240
+ * @returns {IFeatureBuilding[]}
241
+ */
242
+ get features(): MapGeoJSONFeature[];
243
+ /**
244
+ * Get the feature by the specified id
245
+ * @param id: {string}
246
+ * @return {MapGeoJSONFeature | undefined}
247
+ */
248
+ getFeature(id: string): MapGeoJSONFeature | undefined;
249
+ /**
250
+ * Get the building at the point
251
+ * @param point: {PointLike}
252
+ * @return {IFeatureBuilding | undefined}
253
+ */
254
+ getBuildingByPoint(point?: PointLike): IFeatureBuilding | undefined;
255
+ /**
256
+ * Select a building feature
257
+ * @param feature: {IFeatureBuilding | null}
258
+ */
259
+ selectBuilding(feature?: IFeatureBuilding | null): void;
260
+ /**
261
+ * Switch to the building feature
262
+ * @param feature: {IFeatureBuilding}
263
+ */
264
+ switchBuilding(feature: IFeatureBuilding): void;
265
+ /**
266
+ * Select a building and pan to the building
267
+ * @param buildingId: {string}
268
+ * @param callback
269
+ */
270
+ goToBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): void;
271
+ /**
272
+ * Switch floor to filter features
273
+ * @param level: {string}
274
+ */
275
+ switchFloor(level: string): void;
276
+ /**
277
+ * Hide the outdoor map
278
+ * @param isHiddenOutdoor: {boolean}
279
+ */
280
+ hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
281
+ /** Update map after the style changed */
282
+ updateLayers(): void;
283
+ /** filter the layers */
284
+ setFloorsFilter(): void;
285
+ private _getConditionsExpression;
286
+ private _loadData;
287
+ private _init;
288
+ private _load;
289
+ private _clear;
290
+ /**
291
+ * 未选中 venue 其内的 building 显示 venue 历史 ordinal (或 ground ordinal)对应的楼层,如无,则空白
292
+ * @private
293
+ */
294
+ private _initVenues;
295
+ /**
296
+ * Venue 缺少 building_ids 属性其下 building 显示自身最接近地面层
297
+ * @private
298
+ */
299
+ private _initLostBuildings;
300
+ /**
301
+ * 增加需要显示的 level id(s)
302
+ * @param levelIds: {string | string[]}
303
+ * @private
304
+ */
305
+ private _addDisplayedLevels;
306
+ /**
307
+ * 删除显示的 level id(s)
308
+ * @param levelIds: {string | string[]}
309
+ * @private
310
+ */
311
+ private _removeDisplayedLevels;
312
+ private _setCurIndoorStates;
313
+ /***
314
+ * 以 Map<venueId_ordinal, levelId[]> 格式保存当前 venue ordinal-level 的对应关系
315
+ * 把当前 bbox 里 venue 的全部 level ids 保存到变量 "_curVenueLevelIds"
316
+ * @private
317
+ */
318
+ private _setLevelsCache;
319
+ private _updateFilter;
320
+ private _setPoiTextColor;
321
+ private _addTextHaloColor;
322
+ private _getFeatures;
323
+ /**
324
+ * Get selecting building feature
325
+ * @private
326
+ */
327
+ private _getFeatureInfo;
328
+ /**
329
+ * Get level_names 列表,指定 feature,返回 feature 的 level_names;
330
+ * 无则优先 current venue level_names, 无则取 selecting building level_names.
331
+ * @param feature
332
+ * @return string[]
333
+ * @private
334
+ */
335
+ private _getLevelNames;
336
+ private _getBuildingId;
337
+ /**
338
+ * Get current building level id
339
+ * @private
340
+ */
341
+ private _getRefLevel;
342
+ /**
343
+ * Get ordinals 列表, 优先 venue level_ordinals,如无则取 selecting building ordinals
344
+ * @private
345
+ */
346
+ private _getOrdinals;
347
+ /**
348
+ * 获取 venue 或 building 的 ordinal: 有 floor 参数则返回该 floor 对应的 ordinal;
349
+ * 无则返回历史 ordinal(venue 独有) 或离地面层最近的 ordinal.
350
+ * @param feature: {MapGeoJSONFeature}
351
+ * @param floor?: {string}
352
+ * @private
353
+ */
354
+ private _getOrdinal;
355
+ /**
356
+ * 获取当前 building floor
357
+ * @private
358
+ */
359
+ private _getLevelName;
360
+ private _isNotCurrentFeature;
361
+ private _setOutdoorLayersHidden;
362
+ private _addCustomLevelFillLayer;
363
+ }
364
+ export interface IFloorsControlStyle {
365
+ fontColor?: string;
366
+ selectFontColor?: string;
367
+ selectBoxColor?: string;
368
+ }
369
+ export interface IPoiEvent {
370
+ lngLat: maplibregl.LngLat;
371
+ originalEvent: Event;
372
+ point: PointLike;
373
+ feature: Feature<GeometryObject>;
374
+ }
375
+ export interface IFloorEvent {
376
+ floor: string;
377
+ feature: Feature<GeometryObject>;
378
+ }
379
+ export interface IMapClickEvent extends Event {
380
+ point?: PointLike;
381
+ feature?: IFeatureBuilding;
382
+ }
383
+ export declare type TPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
384
+ export declare class Map extends Evented {
385
+ private _map;
386
+ private _indoor;
387
+ private _floorsControl;
388
+ private _buildingFilterControl;
389
+ private _enableFloorControl;
390
+ private _enableBuildingSelector;
391
+ private _poi;
392
+ private _buildingId;
393
+ private _initialHiddenLayers;
394
+ private _attributionControl;
395
+ private _mapZoom;
396
+ private _dispatch;
397
+ private static _getThemeStyleName;
398
+ constructor(option: IMapOption);
399
+ /**
400
+ * Map completely init
401
+ * @param {Function} callback all map operations
402
+ */
403
+ renderComplete(callback: (event: Event) => void): void;
404
+ /**
405
+ * Get indoor information: buildingId, floors...
406
+ * @returns {Indoor}
407
+ */
408
+ getIndoor(): Indoor;
409
+ /** Get map instance */
410
+ getMap(): maplibreMap;
411
+ /**
412
+ * Convert the POI text to the specified language
413
+ * @param language: {string}
414
+ */
415
+ transformPoiTextFieldLanguage(language: string): void;
416
+ /** Turn on indoor and outdoor switching */
417
+ enableSwitch(): this;
418
+ /** Turn off indoor and outdoor switching */
419
+ disableSwitch(): this;
420
+ /** Turn on the buildings switching */
421
+ enableSwitchBuilding(): this;
422
+ /** Turn off the buildings switching */
423
+ disableSwitchBuilding(): this;
424
+ /**
425
+ * To hide the outdoor map
426
+ * @param isHiddenOutdoor: {boolean}
427
+ */
428
+ hiddenOutdoorLayer(isHiddenOutdoor: boolean): void;
429
+ /**
430
+ * Get a list of floors of the selected building
431
+ * @returns {string[]}
432
+ */
433
+ get floors(): string[];
434
+ /**
435
+ * Get the current floor of the selected building
436
+ * @returns {string}
437
+ */
438
+ get currentFloor(): string;
439
+ /**
440
+ * Get the selected building properties
441
+ * @returns {IBuilding | undefined}
442
+ */
443
+ get building(): IBuilding | undefined;
444
+ /**
445
+ * Get feature by the specified id
446
+ * @param id: {string}
447
+ */
448
+ getFeature(id: string): MapGeoJSONFeature | undefined;
449
+ /**
450
+ * Select the building feature to enter its indoor
451
+ * @param feature: {IFeatureBuilding}
452
+ */
453
+ selectBuilding(feature: IFeatureBuilding): this;
454
+ /**
455
+ * Switch the selected building to be the specified id
456
+ * @param buildingId: {string}
457
+ * @param callback
458
+ */
459
+ switchBuilding(buildingId: string, callback?: (feature: Feature<GeometryObject, IBuilding>) => void): this;
460
+ /**
461
+ * Switch to the specified floor
462
+ * @param floor: {string}
463
+ * @param callback
464
+ */
465
+ switchFloor(floor: string, callback?: (object: {
466
+ floor: string;
467
+ feature: IFeatureBuilding;
468
+ }) => void): this;
469
+ /**
470
+ * Listen for mouse click events on the map
471
+ * @param listener
472
+ * @return {unsubscribe}: to remove the event listener
473
+ */
474
+ onMapClickListener(listener: (event: IMapClickEvent) => void): {
475
+ unsubscribe: Function;
476
+ };
477
+ /**
478
+ * Listen for the indoor POI click events
479
+ * @param listener
480
+ * @return {unsubscribe}: to remove the event listener
481
+ */
482
+ onIndoorPoiListener(listener: (result: IPoiEvent) => void): {
483
+ unsubscribe: Function;
484
+ };
485
+ /**
486
+ * Listen for the selected floor changed event
487
+ * @param listener
488
+ * @return {unsubscribe}: to remove the event listener
489
+ */
490
+ onFloorChangeListener(listener: (result: IFloorEvent) => void): {
491
+ unsubscribe: Function;
492
+ };
493
+ /**
494
+ * Listen for the selected building changed event
495
+ * @param listener
496
+ * @return {unsubscribe}: to remove the event listener
497
+ */
498
+ onBuildingChangeListener(listener: (feature: IFeatureBuilding | null) => void): {
499
+ unsubscribe: Function;
500
+ };
501
+ /** Hide the FloorControl */
502
+ disableFloorControl(): this;
503
+ /**
504
+ * set the FloorControl enabled
505
+ * @param position: TPosition
506
+ */
507
+ enableFloorControl(position?: TPosition): this;
508
+ /** Hide the BuildingSelector */
509
+ disableBuildingSelector(): this;
510
+ /**
511
+ * set the BuildingSelector enabled
512
+ * @param position: TPosition
513
+ */
514
+ enableBuildingSelector(position?: TPosition): this;
515
+ /**
516
+ * switch the map style
517
+ * @param theme: {string}
518
+ */
519
+ switchTheme(theme: string): void;
520
+ /**
521
+ * set the floorsControl's style
522
+ * @param style: {IFloorsControlStyle}
523
+ */
524
+ setFloorsControlStyle(style: IFloorsControlStyle): void;
525
+ private _setIndoorFilter;
526
+ private _setStyle;
527
+ private _addControl;
528
+ private _defaultSetMapZoom;
529
+ private _defaultSelectedBuilding;
530
+ private _defaultSelectedPoi;
531
+ }
532
+ export declare type TCoordinates = [
533
+ number,
534
+ number
535
+ ] | [
536
+ number,
537
+ number
538
+ ][];
539
+ /**
540
+ * Map marker
541
+ * support all browser event
542
+ * support floor and building switch
543
+ * allow to define icon and scale
544
+ */
545
+ export declare class Marker extends Evented {
546
+ private _map;
547
+ private _maplibreMap;
548
+ private _coordinates;
549
+ private _floor;
550
+ private _buildingId;
551
+ private readonly _sourceId;
552
+ private readonly _layerId;
553
+ private _imageName;
554
+ private _imageUrl;
555
+ private _imageScale;
556
+ /**
557
+ * Determine whether the coordinates are multi array
558
+ *
559
+ * @private
560
+ * @returns {boolean}
561
+ */
562
+ private static isMultiArray;
563
+ constructor(map?: Map);
564
+ /**
565
+ * @deprecated This method should not be used
566
+ * @param map
567
+ */
568
+ addTo(map: Map): this;
569
+ /**
570
+ * Set up marker handle event
571
+ *
572
+ * @public
573
+ * @param {string} type browser event type, eq. click、dbclick、mouseenter
574
+ * @param {function} callback marker event callback
575
+ */
576
+ onEventListener(type: string, callback: (ev: MapMouseEvent) => void): void;
577
+ /**
578
+ * Create marker content, must have coordinates
579
+ * Markers with the same building and floor can be appended by this function
580
+ * @public
581
+ * @param {number[] | number[][]} coordinates normal array is single point, two-dimensional array is multi points
582
+ * @param {string} floor optional, binding the marker floor, showing markers by floor
583
+ * @param {string} buildingId optional, binding the marker building, showing markers by building
584
+ */
585
+ create(coordinates: TCoordinates, floor?: string, buildingId?: string): this;
586
+ /**
587
+ * Remove marker data
588
+ * no data that will be hidden
589
+ *
590
+ * @public
591
+ */
592
+ remove(): this;
593
+ /**
594
+ * @deprecated This method should not be used
595
+ * @param floor
596
+ * @param buildingId
597
+ */
598
+ switch(floor: string, buildingId: string): this;
599
+ /**
600
+ * Get marker layer id value
601
+ *
602
+ * @public
603
+ * @returns {string}
604
+ */
605
+ get layerId(): string;
606
+ /**
607
+ * Get marker source id value
608
+ *
609
+ * @public
610
+ * @returns {string}
611
+ */
612
+ get sourceId(): string;
613
+ /**
614
+ * Setup define marker icon network url
615
+ *
616
+ * @public
617
+ * @param {string} imageUrl network url, allow format is png、gif、jpg
618
+ */
619
+ setImageUrl(imageUrl: string): this;
620
+ /**
621
+ * Setup define marker icon scale
622
+ *
623
+ * @public
624
+ * @param {number} imageScale 0.1 - 10
625
+ */
626
+ setImageScale(imageScale: number): this;
627
+ private _bindEvents;
628
+ /**
629
+ * Create marker data, contain source and layer
630
+ * 1. create source
631
+ * 2. create layer
632
+ *
633
+ * @private
634
+ */
635
+ private _createData;
636
+ /**
637
+ * Load and set the marker icon.
638
+ *
639
+ * @private
640
+ * @param url
641
+ * @param {function} callback loaded callback function
642
+ */
643
+ private _loadImage;
644
+ /**
645
+ * Add marker data source, contain marker properties
646
+ *
647
+ * @private
648
+ */
649
+ private _addSource;
650
+ /**
651
+ * Add marker data layer, contain marker style
652
+ *
653
+ * @private
654
+ */
655
+ private _addLayer;
656
+ private _setFilter;
657
+ }
658
+ export declare class Poi {
659
+ private _map;
660
+ private _layers;
661
+ private _dispatch;
662
+ constructor(map: maplibregl.Map);
663
+ /**
664
+ * Listen for the POI clicked event
665
+ * @param listener
666
+ * @return {unsubscribe}: to remove the event listener
667
+ */
668
+ onPointClick(listener: (result: IPoiEvent) => void): {
669
+ unsubscribe: Function;
670
+ };
671
+ /**
672
+ * Init the data after the style data is loaded
673
+ * @private
674
+ */
675
+ private _loadData;
676
+ /**
677
+ * 1. Get layer id is match `poi` name data
678
+ * 2. Init map on-click event
679
+ *
680
+ * @private
681
+ */
682
+ private _init;
683
+ /**
684
+ * Map on-click poi event
685
+ * if have poiClickFunction callback
686
+ * and then return the poi data to callback function
687
+ *
688
+ * @private
689
+ */
690
+ private _initClick;
691
+ }
692
+ export declare class FloorsControl implements IControl {
693
+ private _map;
694
+ private _$container;
695
+ private _indoor;
696
+ private _$layout;
697
+ private _$outer;
698
+ private _$inner;
699
+ private _$arrowUp;
700
+ private _$arrowDown;
701
+ private _floor;
702
+ private _venueId;
703
+ private _ordinal;
704
+ private _fontColor;
705
+ private _selectFontColor;
706
+ private _selectBoxColor;
707
+ private _$currentButton;
708
+ private _$floorControlButtons;
709
+ private _enableFloorControl;
710
+ private _position;
711
+ private _dispatch;
712
+ private static _$createFloor;
713
+ constructor(map: Map, position?: TPosition);
714
+ get position(): TPosition;
715
+ get enabled(): boolean;
716
+ onAdd(map: maplibreMap): HTMLElement;
717
+ onRemove(): void;
718
+ onFloorClick(listener: (result: IFloorEvent) => void): {
719
+ unsubscribe: Function;
720
+ };
721
+ switchFloor(floor: string, callback?: (object: {
722
+ floor: string;
723
+ feature: IFeatureBuilding;
724
+ }) => void): void;
725
+ setStyle(style: IFloorsControlStyle): void;
726
+ setLayoutHidden(isHidden: boolean): void;
727
+ moveFloorControl(from: TPosition, to: TPosition): void;
728
+ private _listener;
729
+ /**
730
+ * Triggered when the user on-click on the building
731
+ * 1. click current building
732
+ * 2. click other building (new building)
733
+ * @param event {IBuildingSelectEvent}
734
+ */
735
+ private _init;
736
+ /**
737
+ * Triggered when the user move end on the map
738
+ */
739
+ private _refresh;
740
+ private _$createLayout;
741
+ private _$configLayoutHeight;
742
+ private _$configArrowDownTop;
743
+ private _$showOrHideArrow;
744
+ private _$showLayout;
745
+ private _$hideLayout;
746
+ private _$showArrowUp;
747
+ private _$hideArrowUp;
748
+ private _$showArrowDown;
749
+ private _$hideArrowDown;
750
+ private _$createFloors;
751
+ private _$clearFloors;
752
+ private _isEmptyFloors;
753
+ private _isOverflowFloorMax;
754
+ private _isEnableDisplay;
755
+ private _scrollToClickedFloor;
756
+ private _setCurrentButtonActive;
757
+ private _floorClick;
758
+ private _floorScroll;
759
+ private _floorClickEvent;
760
+ private _floorScrollEvent;
761
+ private _bindEvent;
762
+ private _getCurrentFloor;
763
+ }
764
+ export declare class BuildingFilterControl implements maplibregl.IControl {
765
+ private _map;
766
+ private _indoor;
767
+ private _buildingId;
768
+ private _features;
769
+ private _container;
770
+ private _buildingNameLayout;
771
+ private _buildingNameList;
772
+ private _enableBuildingSelector;
773
+ private readonly _position;
774
+ constructor(map: Map, position?: TPosition);
775
+ onAdd(map: MaplibreMap): HTMLElement;
776
+ onRemove(): void;
777
+ get position(): TPosition;
778
+ get enabled(): boolean;
779
+ setLayoutHidden(isHidden: boolean): void;
780
+ moveBuildingFilter(from: TPosition, to: TPosition): void;
781
+ private _loadData;
782
+ private _init;
783
+ private _refresh;
784
+ private _select;
785
+ private _load;
786
+ private _getFeatureByName;
787
+ private _buildingFilterIconCreate;
788
+ private _buildingNameListCreate;
789
+ private _buildingNameListUpdate;
790
+ private _buildingNameListClean;
791
+ private _buildingNameListHeight;
792
+ private _buildingNameCreate;
793
+ private _toggleList;
794
+ private _buildingNameClickEvent;
795
+ private _buildingToggleListEvent;
796
+ private _$showLayout;
797
+ private _$hideLayout;
798
+ }
799
+ export interface IResponseBuildings {
800
+ buildings: ISearchBuilding[];
801
+ total: number;
802
+ }
803
+ export interface IResponse<T> {
804
+ code: number;
805
+ message: string;
806
+ result: T;
807
+ }
808
+ export declare class BuildingsService {
809
+ private _api;
810
+ private _request;
811
+ constructor();
812
+ searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponseBuildings>>;
813
+ searchByDistance(keywords: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
814
+ searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
815
+ searchByGlobal(keywords: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponseBuildings>>;
816
+ private _changedRes;
817
+ }
818
+ export interface ILocation {
819
+ lat: number;
820
+ lon: number;
821
+ }
822
+ export interface IPoi {
823
+ address?: string;
824
+ buildingId: string;
825
+ category?: string;
826
+ description?: string;
827
+ email?: string;
828
+ floor: string;
829
+ id: string;
830
+ location: ILocation;
831
+ name: IMultiLangName;
832
+ openingHours?: string;
833
+ osmRefId?: number;
834
+ phone?: string;
835
+ poiId?: string;
836
+ website?: string;
837
+ }
838
+ export interface IResponsePois {
839
+ pois: IPoi[];
840
+ total: number;
841
+ }
842
+ export interface IOrientationPoi {
843
+ angle: number;
844
+ buildingId: string;
845
+ distance: number;
846
+ floor: string;
847
+ location: ILocation;
848
+ name: object;
849
+ poiId: string;
850
+ }
851
+ export interface IResponseOrientationPoi {
852
+ orientationPois: IOrientationPoi[];
853
+ total: number;
854
+ }
855
+ export declare class PoisService {
856
+ private _api;
857
+ private _categories;
858
+ private _request;
859
+ constructor();
860
+ /**
861
+ * Search poi by poi ids, allow multi poi id
862
+ *
863
+ * @param ids: string | string[]
864
+ */
865
+ searchByIds(ids: string | string[]): AxiosPromise<IResponse<IResponsePois>>;
866
+ /**
867
+ * Search poi by radius distance of the center point
868
+ *
869
+ * @param category poi category
870
+ * @param center coordinate, [lng, lat]
871
+ * @param distance unit: meter, radius distance of the center point
872
+ * @param offset default 10
873
+ * @param page default 1
874
+ */
875
+ searchByDistance(category: string, center: number[], distance: number, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
876
+ /**
877
+ * Search poi by within bbox range
878
+ *
879
+ * @param keywords poi name
880
+ * @param bbox within, [min_lon, min_lat, max_lon, max_lat]
881
+ * @param offset default 10
882
+ * @param page default 1
883
+ */
884
+ searchByBbox(keywords: string, bbox: number[], offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
885
+ /**
886
+ * Search poi by within building
887
+ *
888
+ * @param keywords poi name
889
+ * @param buildingId within the building
890
+ * @param offset default 10
891
+ * @param page default 1
892
+ */
893
+ searchByBuildingId(keywords: string, buildingId: string, offset?: number, page?: number): AxiosPromise<IResponse<IResponsePois>>;
894
+ /**
895
+ * Search poi category by within building
896
+ *
897
+ * @param buildingId within the building
898
+ * @param floor option param, within floor
899
+ */
900
+ searchCategory(buildingId: string, floor?: string): AxiosPromise<IResponse<string[]>>;
901
+ /**
902
+ * Search orientation and poi
903
+ *
904
+ * @param angle the angle between cellphone's orientation and the north
905
+ * @param buildingId within the building
906
+ * @param center the user's current position, [lon, lat]
907
+ * @param distance unit: meter, radius distance of the center point
908
+ * @param distanceSearchType search type default Point
909
+ * @param floor within floor
910
+ */
911
+ searchOrientation(angle: number, buildingId: string, center: number[], distance: number, distanceSearchType: string, floor: string): AxiosPromise<IResponse<IResponseOrientationPoi>>;
912
+ private _changedRes;
913
+ }
914
+ export interface IResponseRoute {
915
+ hints: IRouteHints;
916
+ info: IRouteInfo;
917
+ paths: IRoutePaths[];
918
+ }
919
+ export interface IRouteHints {
920
+ "visited_nodes.average": string;
921
+ "visited_nodes.sum": string;
922
+ }
923
+ export interface IRouteInfo {
924
+ copyrights: string[];
925
+ took: number;
926
+ }
927
+ export interface IRoutePaths {
928
+ ascend: number;
929
+ bbox: number[];
930
+ descend: number;
931
+ details: object;
932
+ distance: number;
933
+ instructions: any;
934
+ legs: number[];
935
+ points: string | FeatureCollection<LineString>;
936
+ points_encoded: boolean;
937
+ snapped_waypoints: string;
938
+ time: number;
939
+ transfers: number;
940
+ weight: number;
941
+ }
942
+ export declare class RouteService {
943
+ private _api;
944
+ private _request;
945
+ constructor();
946
+ /**
947
+ * Search wayfinding result, support across building query
948
+ *
949
+ * @param fromCoord from coordinate [lng, lat] (start point)
950
+ * @param toCoord to coordinate [lng, lat] (end point)
951
+ * @param fromFloor from building's floor (start point)
952
+ * @param toFloor to building's floor (end point)
953
+ * @param fromBuildingId from building (start point)
954
+ * @param toBuildingId to building (end point)
955
+ * @param vehicle option param, Available values : foot, wheelchair, default foot
956
+ * @param locale option param, result return language
957
+ * @param toDoor option param, if end point result in the room, wayfinding result will only to the door, default `true`
958
+ */
959
+ search(fromCoord: number[], toCoord: number[], fromFloor: string, toFloor: string, fromBuildingId: string, toBuildingId: string, vehicle?: string, locale?: string, toDoor?: boolean): AxiosPromise<IResponse<IResponseRoute>>;
960
+ }
961
+ export declare const version: string;
962
+
963
+ export {};