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