@mapsindoors/react-native-maps-indoors-mapbox 2.6.0 → 2.6.1
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/android/build.gradle +1 -1
- package/package.json +1 -1
- package/react-native-maps-indoors-mapbox.podspec +2 -2
- package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +0 -322
- package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +0 -166
- package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +0 -1699
- package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +0 -761
- package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +0 -410
- package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +0 -16
- package/android/src/main/java/com/mapsindoorsrn/core/README.md +0 -3
- package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +0 -227
- package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +0 -22
- package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +0 -19
- package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +0 -77
- package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +0 -17
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +0 -34
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +0 -68
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +0 -38
- package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +0 -46
- package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +0 -117
- package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +0 -30
- package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +0 -35
- package/ios/core/CameraPosition.swift +0 -15
- package/ios/core/CameraUpdate.swift +0 -19
- package/ios/core/CameraUpdateError.swift +0 -11
- package/ios/core/DirectionsRendererBridge.m +0 -59
- package/ios/core/DirectionsRendererModule.swift +0 -359
- package/ios/core/DirectionsServiceBridge.m +0 -55
- package/ios/core/DirectionsServiceModule.swift +0 -186
- package/ios/core/IconStopUrl.swift +0 -17
- package/ios/core/LabelGraphic.swift +0 -15
- package/ios/core/MPDisplayRuleBridge.m +0 -696
- package/ios/core/MPDisplayRuleModule.swift +0 -1704
- package/ios/core/MapControlBridge.m +0 -213
- package/ios/core/MapControlModule.swift +0 -702
- package/ios/core/MapsIndoorsBridge.m +0 -128
- package/ios/core/MapsIndoorsData.swift +0 -288
- package/ios/core/MapsIndoorsModule.swift +0 -363
- package/ios/core/RCMapView.swift +0 -16
- package/ios/core/README.md +0 -3
- package/ios/core/ReactPositionProvider.swift +0 -27
- package/ios/core/RouteIcon.swift +0 -34
- package/ios/core/UtilsBridge.m +0 -73
- package/ios/core/UtilsModule.swift +0 -182
- package/ios/core/helpers.swift +0 -57
- package/src/core/EventNames.ts +0 -21
- package/src/core/MPAdditionalDetail.ts +0 -102
- package/src/core/MPBadgePosition.ts +0 -12
- package/src/core/MPBounds.ts +0 -155
- package/src/core/MPBuilding.ts +0 -333
- package/src/core/MPBuildingCollection.ts +0 -57
- package/src/core/MPBuildingInfo.ts +0 -63
- package/src/core/MPCameraEvent.ts +0 -17
- package/src/core/MPCameraEventListener.ts +0 -17
- package/src/core/MPCameraPosition.ts +0 -82
- package/src/core/MPCameraUpdate.ts +0 -174
- package/src/core/MPCameraViewFitMode.ts +0 -25
- package/src/core/MPCategory.ts +0 -85
- package/src/core/MPCategoryCollection.ts +0 -62
- package/src/core/MPCollection.ts +0 -59
- package/src/core/MPCollisionHandling.ts +0 -12
- package/src/core/MPDailyOpeningHours.ts +0 -67
- package/src/core/MPDataField.ts +0 -69
- package/src/core/MPDetailType.ts +0 -73
- package/src/core/MPDirectionsRenderer.ts +0 -238
- package/src/core/MPDirectionsService.ts +0 -152
- package/src/core/MPDisplayRule.ts +0 -1823
- package/src/core/MPEntity.ts +0 -60
- package/src/core/MPEntityInfo.ts +0 -28
- package/src/core/MPError.ts +0 -122
- package/src/core/MPFeatureTypes.ts +0 -8
- package/src/core/MPFilter.ts +0 -168
- package/src/core/MPFilterBehavior.ts +0 -115
- package/src/core/MPFloor.ts +0 -170
- package/src/core/MPFloorSelectorInterface.ts +0 -63
- package/src/core/MPGeometry.ts +0 -91
- package/src/core/MPHighlightBehavior.ts +0 -115
- package/src/core/MPHighway.ts +0 -14
- package/src/core/MPIconPlacement.ts +0 -13
- package/src/core/MPIconSize.ts +0 -39
- package/src/core/MPLabelGraphic.ts +0 -24
- package/src/core/MPLabelPosition.ts +0 -12
- package/src/core/MPLabelType.ts +0 -11
- package/src/core/MPLocation.ts +0 -440
- package/src/core/MPLocationPropertyNames.ts +0 -30
- package/src/core/MPLocationSettings.ts +0 -40
- package/src/core/MPLocationType.ts +0 -16
- package/src/core/MPMapConfig.ts +0 -280
- package/src/core/MPMapStyle.ts +0 -57
- package/src/core/MPMultiPolygon.ts +0 -218
- package/src/core/MPOpeningHours.ts +0 -48
- package/src/core/MPPOIType.ts +0 -43
- package/src/core/MPPoint.ts +0 -169
- package/src/core/MPPolygon.ts +0 -219
- package/src/core/MPPositionProviderInterface.ts +0 -45
- package/src/core/MPPositionResultInterface.ts +0 -42
- package/src/core/MPPropertyData.ts +0 -234
- package/src/core/MPQuery.ts +0 -69
- package/src/core/MPRoute.ts +0 -105
- package/src/core/MPRouteCoordinate.ts +0 -95
- package/src/core/MPRouteLeg.ts +0 -158
- package/src/core/MPRouteProperty.ts +0 -83
- package/src/core/MPRouteStep.ts +0 -186
- package/src/core/MPRouteStopIconConfig.ts +0 -82
- package/src/core/MPSelectionBehavior.ts +0 -114
- package/src/core/MPSelectionMode.ts +0 -4
- package/src/core/MPSettings3D.ts +0 -107
- package/src/core/MPSize.ts +0 -21
- package/src/core/MPSolution.ts +0 -189
- package/src/core/MPSolutionConfig.ts +0 -188
- package/src/core/MPSolutionDisplayRule.ts +0 -15
- package/src/core/MPUserRole.ts +0 -60
- package/src/core/MPUserRoleCollection.ts +0 -37
- package/src/core/MPUtils.ts +0 -178
- package/src/core/MPVenue.ts +0 -294
- package/src/core/MPVenueCollection.ts +0 -58
- package/src/core/MPVenueInfo.ts +0 -62
- package/src/core/MPWeeklyOpeningHours.ts +0 -129
- package/src/core/MapControl.ts +0 -961
- package/src/core/MapView.tsx +0 -34
- package/src/core/MapsIndoors.ts +0 -571
- package/src/core/OnBuildingFoundAtCameraTargetListener.ts +0 -17
- package/src/core/OnFloorSelectionChangedListener.ts +0 -17
- package/src/core/OnFloorUpdateListener.ts +0 -16
- package/src/core/OnLegSelectedListener.ts +0 -17
- package/src/core/OnLiveLocationUpdateListener.ts +0 -17
- package/src/core/OnLocationSelectedListener.ts +0 -17
- package/src/core/OnMapClickListener.ts +0 -20
- package/src/core/OnMarkerClickListener.ts +0 -17
- package/src/core/OnMarkerInfoWindowClickListener.ts +0 -17
- package/src/core/OnPositionUpdateListener.ts +0 -17
- package/src/core/OnVenueFoundAtCameraTargetListener.ts +0 -17
- package/src/core/README.md +0 -3
- package/src/core/RouteStopIconConfig.ts +0 -10
package/src/core/MPBuilding.ts
DELETED
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import MPEntity from "./MPEntity";
|
|
2
|
-
import { MPPoint, MPPolygon, MPFloor, MPBounds, MPDataField, MPPointParams, MPFloorParams } from "../../index";
|
|
3
|
-
import MPBuildingInfo, { MPBuildingInfoParams } from "./MPBuildingInfo";
|
|
4
|
-
import { Platform } from "react-native";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* An entity that contains information about a specific building.
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
|
-
* @class MPBuilding
|
|
11
|
-
* @typedef {MPBuilding}
|
|
12
|
-
* @extends {MPEntity}
|
|
13
|
-
*/
|
|
14
|
-
export default class MPBuilding extends MPEntity {
|
|
15
|
-
/**
|
|
16
|
-
* Creates an instance of MPBuilding.
|
|
17
|
-
*
|
|
18
|
-
* @constructor
|
|
19
|
-
* @private
|
|
20
|
-
* @param {string} id The building's ID.
|
|
21
|
-
* @param {string} administrativeId The building's readable ID.
|
|
22
|
-
* @param {string} externalId An ID used to map the building to a customer's ID.
|
|
23
|
-
* @param {string} venueId The ID of the venue this building lies within.
|
|
24
|
-
* @param {MPPoint} anchor The anchor point for the building.
|
|
25
|
-
* @param {MPPolygon} geometry The geometry of the building.
|
|
26
|
-
* @param {Map<number, MPFloor>} _floors A map of the floors inside the building.
|
|
27
|
-
* @param {number} defaultFloor The default floor index for the building.
|
|
28
|
-
* @param {string} address The building's address.
|
|
29
|
-
* @param {?MPBuildingInfo} [buildingInfo] A collection of information about the building.
|
|
30
|
-
*/
|
|
31
|
-
private constructor(
|
|
32
|
-
private readonly id: string,
|
|
33
|
-
public readonly administrativeId: string,
|
|
34
|
-
public readonly externalId: string,
|
|
35
|
-
public readonly venueId: string,
|
|
36
|
-
private readonly anchor: MPPoint,
|
|
37
|
-
public readonly geometry: MPPolygon,
|
|
38
|
-
private readonly _floors: Map<number, MPFloor>,
|
|
39
|
-
public readonly defaultFloor: number,
|
|
40
|
-
public readonly address: string,
|
|
41
|
-
private readonly buildingInfo?: MPBuildingInfo,
|
|
42
|
-
) {
|
|
43
|
-
super("MPBuilding");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Creator for MPBounds, used to decode JSON from the MapsIndoors SDK.
|
|
48
|
-
*
|
|
49
|
-
* @public
|
|
50
|
-
* @static
|
|
51
|
-
* @param {MPBuildingParams} object
|
|
52
|
-
* @returns {MPBuilding}
|
|
53
|
-
*/
|
|
54
|
-
public static create(object: MPBuildingParams): MPBuilding {
|
|
55
|
-
let floors: Map<number, MPFloor> = new Map();
|
|
56
|
-
if (object?.floors !== undefined) {
|
|
57
|
-
floors = new Map(Object.entries(object?.floors).map(([key, value]) => [Number.parseInt(key), MPFloor.create(value as MPFloorParams)]));
|
|
58
|
-
// Object.keys(object?.floors).forEach(key => {
|
|
59
|
-
// floors.set(Number.parseInt(key), MPFloor.create(object?.floors[key] as unknown as MPFloorParams))
|
|
60
|
-
// });
|
|
61
|
-
}
|
|
62
|
-
floors.forEach((value: MPFloor) => {
|
|
63
|
-
value.buildingId = object?.id;
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
var polygon;
|
|
67
|
-
|
|
68
|
-
if(Platform.OS === 'ios') {
|
|
69
|
-
polygon = MPPolygon.create({coordinates: object?.geometry, bbox: [].concat(object?.boundingBox?.southwest, object?.boundingBox?.northeast)});
|
|
70
|
-
}else {
|
|
71
|
-
polygon = MPPolygon.create(object?.geometry);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return new MPBuilding(
|
|
75
|
-
object?.id,
|
|
76
|
-
object?.administrativeId,
|
|
77
|
-
object?.externalId,
|
|
78
|
-
object?.venueId,
|
|
79
|
-
MPPoint.create(object?.anchor),
|
|
80
|
-
polygon,
|
|
81
|
-
floors,
|
|
82
|
-
object?.defaultFloor,
|
|
83
|
-
object?.address,
|
|
84
|
-
MPBuildingInfo.create(object?.buildingInfo as MPBuildingInfoParams),
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get the building's id.
|
|
90
|
-
*
|
|
91
|
-
* @public
|
|
92
|
-
* @readonly
|
|
93
|
-
* @type {string}
|
|
94
|
-
*/
|
|
95
|
-
public get buildingId(): string {
|
|
96
|
-
return this.id;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Get the building's bounds.
|
|
101
|
-
*
|
|
102
|
-
* @public
|
|
103
|
-
* @readonly
|
|
104
|
-
* @type {MPBounds}
|
|
105
|
-
*/
|
|
106
|
-
public get bounds(): MPBounds {
|
|
107
|
-
return this.geometry.bounds;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get the position of the building, this will correspond to the building's anchor point.
|
|
112
|
-
*
|
|
113
|
-
* @public
|
|
114
|
-
* @readonly
|
|
115
|
-
* @type {MPPoint}
|
|
116
|
-
*/
|
|
117
|
-
public get position(): MPPoint {
|
|
118
|
-
return this.anchor;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Overload from MPEntity, will return false.
|
|
123
|
-
*
|
|
124
|
-
* @public
|
|
125
|
-
* @readonly
|
|
126
|
-
* @type {boolean}
|
|
127
|
-
*/
|
|
128
|
-
public get isPoint(): boolean {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Get the building's name.
|
|
134
|
-
*
|
|
135
|
-
* @public
|
|
136
|
-
* @readonly
|
|
137
|
-
* @type {string}
|
|
138
|
-
*/
|
|
139
|
-
public get name(): string {
|
|
140
|
-
return this.buildingInfo?.name ? this.buildingInfo.name : "";
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Get a list of aliases for the building.
|
|
145
|
-
*
|
|
146
|
-
* @public
|
|
147
|
-
* @readonly
|
|
148
|
-
* @type {string[]}
|
|
149
|
-
*/
|
|
150
|
-
public get aliases(): string[] {
|
|
151
|
-
return this.buildingInfo?.aliases ? this.buildingInfo.aliases : [];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Get the number of {@link MPFloor}s in the building.
|
|
156
|
-
*
|
|
157
|
-
* @public
|
|
158
|
-
* @readonly
|
|
159
|
-
* @type {number}
|
|
160
|
-
*/
|
|
161
|
-
public get floorCount(): number {
|
|
162
|
-
return this._floors.size;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Get a list of the floors in the building.
|
|
167
|
-
*
|
|
168
|
-
* @public
|
|
169
|
-
* @readonly
|
|
170
|
-
* @type {MPFloor[]}
|
|
171
|
-
*/
|
|
172
|
-
public get floors(): MPFloor[] {
|
|
173
|
-
return Array.from(this._floors.values());
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Get the default floor index.
|
|
178
|
-
*
|
|
179
|
-
* @public
|
|
180
|
-
* @readonly
|
|
181
|
-
* @type {number}
|
|
182
|
-
*/
|
|
183
|
-
public get initialFloorIndex(): number {
|
|
184
|
-
return this.defaultFloor ? this.defaultFloor : this.floors[0].floorIndex ? this.floors[0].floorIndex : 0;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Check whether the building contains a floor with the {@link floorIndex}.
|
|
189
|
-
*
|
|
190
|
-
* @public
|
|
191
|
-
* @param {number} floorIndex
|
|
192
|
-
* @returns {boolean}
|
|
193
|
-
*/
|
|
194
|
-
public hasFloorIndex(floorIndex: number): boolean {
|
|
195
|
-
return this._floors.has(floorIndex);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Get a floor by its floor index.
|
|
200
|
-
*
|
|
201
|
-
* @public
|
|
202
|
-
* @param {number} floorIndex
|
|
203
|
-
* @returns {MPFloor}
|
|
204
|
-
*/
|
|
205
|
-
public getFloorByIndex(floorIndex: number): MPFloor | undefined {
|
|
206
|
-
return this._floors.get(floorIndex);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Fetch a custom field from the building.
|
|
211
|
-
*
|
|
212
|
-
* @public
|
|
213
|
-
* @param {?string} [key]
|
|
214
|
-
* @returns {(MPDataField | undefined)}
|
|
215
|
-
*/
|
|
216
|
-
public getField(key?: string): MPDataField | undefined {
|
|
217
|
-
if (key !== undefined) {
|
|
218
|
-
return this.buildingInfo?.fields?.get(key);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Check whether the building's geometry contains the point.
|
|
224
|
-
*
|
|
225
|
-
* @public
|
|
226
|
-
* @async
|
|
227
|
-
* @param {MPPoint} point
|
|
228
|
-
* @returns {Promise<boolean>}
|
|
229
|
-
*/
|
|
230
|
-
public async contains(point: MPPoint): Promise<boolean> {
|
|
231
|
-
return this.geometry.contains(point);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
237
|
-
*
|
|
238
|
-
* @public
|
|
239
|
-
* @returns {MPBuildingParams}
|
|
240
|
-
*/
|
|
241
|
-
public toJSON(): MPBuildingParams {
|
|
242
|
-
return {
|
|
243
|
-
"id": this.id,
|
|
244
|
-
"administrativeId": this.administrativeId,
|
|
245
|
-
"externalId": this.externalId,
|
|
246
|
-
"venueId": this.venueId,
|
|
247
|
-
"anchor": this.anchor.toJSON(),
|
|
248
|
-
"buildingInfo": this.buildingInfo,
|
|
249
|
-
"geometry": this.geometry,
|
|
250
|
-
"floors": this._floors,
|
|
251
|
-
"defaultFloor": this.defaultFloor,
|
|
252
|
-
"address": this.address,
|
|
253
|
-
"boundingBox": this.bounds.toJSON()
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Parameter interface for {@link MPBuilding}.
|
|
260
|
-
*
|
|
261
|
-
* @export
|
|
262
|
-
* @interface MPBuildingParams
|
|
263
|
-
* @typedef {MPBuildingParams}
|
|
264
|
-
*/
|
|
265
|
-
export interface MPBuildingParams {
|
|
266
|
-
/**
|
|
267
|
-
* The building's ID.
|
|
268
|
-
*
|
|
269
|
-
* @type {string}
|
|
270
|
-
*/
|
|
271
|
-
id: string,
|
|
272
|
-
/**
|
|
273
|
-
* The building's readable ID.
|
|
274
|
-
*
|
|
275
|
-
* @type {string}
|
|
276
|
-
*/
|
|
277
|
-
administrativeId: string,
|
|
278
|
-
/**
|
|
279
|
-
* An ID used to map the building to a customer's ID.
|
|
280
|
-
*
|
|
281
|
-
* @type {string}
|
|
282
|
-
*/
|
|
283
|
-
externalId: string,
|
|
284
|
-
/**
|
|
285
|
-
* The ID of the venue this building lies within.
|
|
286
|
-
*
|
|
287
|
-
* @type {string}
|
|
288
|
-
*/
|
|
289
|
-
venueId: string,
|
|
290
|
-
/**
|
|
291
|
-
* The anchor point for the building.
|
|
292
|
-
*
|
|
293
|
-
* @type {MPPointParams}
|
|
294
|
-
*/
|
|
295
|
-
anchor: MPPointParams,
|
|
296
|
-
/**
|
|
297
|
-
* The geometry of the building.
|
|
298
|
-
*
|
|
299
|
-
* @type {MPPolygon}
|
|
300
|
-
*/
|
|
301
|
-
geometry: MPPolygon | any,
|
|
302
|
-
/**
|
|
303
|
-
* A map of the floors inside the building.
|
|
304
|
-
*
|
|
305
|
-
*/
|
|
306
|
-
floors: object,
|
|
307
|
-
/**
|
|
308
|
-
* The default floor index for the building.
|
|
309
|
-
*
|
|
310
|
-
* @type {number}
|
|
311
|
-
*/
|
|
312
|
-
defaultFloor: number,
|
|
313
|
-
/**
|
|
314
|
-
* The building's address.
|
|
315
|
-
*
|
|
316
|
-
* @type {string}
|
|
317
|
-
*/
|
|
318
|
-
address: string,
|
|
319
|
-
/**
|
|
320
|
-
* A collection of information about the building.
|
|
321
|
-
*
|
|
322
|
-
* @type {?MPBuildingInfo}
|
|
323
|
-
*/
|
|
324
|
-
buildingInfo?: MPBuildingInfo,
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* A object of two arrays representing coordinates
|
|
328
|
-
* Northeast & Southwest
|
|
329
|
-
*
|
|
330
|
-
* @type {any}
|
|
331
|
-
*/
|
|
332
|
-
boundingBox?: any
|
|
333
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import MPBuilding from "./MPBuilding";
|
|
2
|
-
import MPCollection from "./MPCollection";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A simple collection holder for buildings.
|
|
6
|
-
*
|
|
7
|
-
* @export
|
|
8
|
-
* @class MPBuildingCollection
|
|
9
|
-
* @typedef {MPBuildingCollection}
|
|
10
|
-
* @extends {MPCollection<MPBuilding>}
|
|
11
|
-
*/
|
|
12
|
-
export default class MPBuildingCollection extends MPCollection<MPBuilding> {
|
|
13
|
-
/**
|
|
14
|
-
* A custom map of buildings by their names.
|
|
15
|
-
*
|
|
16
|
-
* @private
|
|
17
|
-
* @type {!Map<String, MPBuilding>}
|
|
18
|
-
*/
|
|
19
|
-
private nameMap!: Map<String, MPBuilding>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of MPBuildingCollection.
|
|
23
|
-
*
|
|
24
|
-
* @constructor
|
|
25
|
-
* @private
|
|
26
|
-
* @param {MPBuilding[]} buildings A collection of buildings used in MapsIndoors.
|
|
27
|
-
*/
|
|
28
|
-
private constructor(buildings: MPBuilding[]) {
|
|
29
|
-
super();
|
|
30
|
-
this.map = new Map(buildings.map((building) => [building.buildingId, building]));
|
|
31
|
-
this.nameMap = new Map(buildings.map((building) => [building.administrativeId.toLowerCase(), building]));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get a building by its {@link MPBuilding.administrativeId}.
|
|
36
|
-
*
|
|
37
|
-
* @public
|
|
38
|
-
* @param {string} id
|
|
39
|
-
* @returns {(MPBuilding | undefined)}
|
|
40
|
-
*/
|
|
41
|
-
public getBuildingByAdminId(id: string) : MPBuilding | undefined {
|
|
42
|
-
return this.nameMap.get(id.toLowerCase());
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Creator for MPBuildingCollection, used to decode JSON from the MapsIndoors SDK.
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
* @static
|
|
50
|
-
* @param {?*} [object]
|
|
51
|
-
* @returns {MPBuildingCollection}
|
|
52
|
-
*/
|
|
53
|
-
public static create(object?: any) : MPBuildingCollection {
|
|
54
|
-
let buildings: MPBuilding[] = object?.map((building: any) => MPBuilding.create(building));
|
|
55
|
-
return new MPBuildingCollection(buildings);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import MPDataField from "./MPDataField";
|
|
2
|
-
import { MPEntityInfo } from "./MPEntityInfo";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A collection of information about a {@link MPBuilding}.
|
|
6
|
-
*
|
|
7
|
-
* @export
|
|
8
|
-
* @class MPBuildingInfo
|
|
9
|
-
* @typedef {MPBuildingInfo}
|
|
10
|
-
* @extends {MPEntityInfo}
|
|
11
|
-
*/
|
|
12
|
-
export default class MPBuildingInfo extends MPEntityInfo {
|
|
13
|
-
/**
|
|
14
|
-
* Creator for MPBuildingInfo, used to decode JSON from the MapsIndoors SDK.
|
|
15
|
-
*
|
|
16
|
-
* @public
|
|
17
|
-
* @static
|
|
18
|
-
* @param {MPBuildingInfoParams} object
|
|
19
|
-
* @returns {MPBuildingInfo}
|
|
20
|
-
*/
|
|
21
|
-
public static create(object: MPBuildingInfoParams): MPBuildingInfo {
|
|
22
|
-
return new MPBuildingInfo(
|
|
23
|
-
object?.name,
|
|
24
|
-
object?.aliases,
|
|
25
|
-
object?.fields,
|
|
26
|
-
object?.language,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Parameter interface for {@link MPBuildingInfo}.
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @interface MPBuildingInfoParams
|
|
36
|
-
* @typedef {MPBuildingInfoParams}
|
|
37
|
-
*/
|
|
38
|
-
export interface MPBuildingInfoParams {
|
|
39
|
-
/**
|
|
40
|
-
* The name of the building.
|
|
41
|
-
*
|
|
42
|
-
* @type {string}
|
|
43
|
-
*/
|
|
44
|
-
name: string,
|
|
45
|
-
/**
|
|
46
|
-
* An array of aliases used by the building.
|
|
47
|
-
*
|
|
48
|
-
* @type {?string[]}
|
|
49
|
-
*/
|
|
50
|
-
aliases?: string[],
|
|
51
|
-
/**
|
|
52
|
-
* A number of data fields on the venue.
|
|
53
|
-
*
|
|
54
|
-
* @type {?Map<string, MPDataField>}
|
|
55
|
-
*/
|
|
56
|
-
fields?: Map<string, MPDataField>,
|
|
57
|
-
/**
|
|
58
|
-
* The language the venue currently uses.
|
|
59
|
-
*
|
|
60
|
-
* @type {?string}
|
|
61
|
-
*/
|
|
62
|
-
language?: string,
|
|
63
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import MPCameraEventListener from "../../index"
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Possible events that a {@link MPCameraEventListener} can recieve.
|
|
5
|
-
*
|
|
6
|
-
* @enum {number}
|
|
7
|
-
*/
|
|
8
|
-
enum MPCameraEvent {
|
|
9
|
-
finished = 0,
|
|
10
|
-
cancelled = 1,
|
|
11
|
-
moveStartedApiAnimation = 2,
|
|
12
|
-
moveStartedDeveloperAnimation = 3,
|
|
13
|
-
moveStartedGesture = 4,
|
|
14
|
-
onMove = 5,
|
|
15
|
-
moveCancelled = 6,
|
|
16
|
-
idle = 7,
|
|
17
|
-
} export default MPCameraEvent
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { MPCameraEvent } from "../../index";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Listens for camera events, eg. when the Camera starts or stops moving.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @interface MPCameraEventListener
|
|
8
|
-
* @typedef {MPCameraEventListener}
|
|
9
|
-
*/
|
|
10
|
-
export default interface MPCameraEventListener {
|
|
11
|
-
/**
|
|
12
|
-
* When a {@link MPCameraEvent} happens.
|
|
13
|
-
*
|
|
14
|
-
* @param {MPCameraEvent} event
|
|
15
|
-
*/
|
|
16
|
-
(event: MPCameraEvent): void;
|
|
17
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import MPPoint from "./MPPoint";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A camera position object, used to move the camera to a specific position.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @class MPCameraPosition
|
|
8
|
-
* @typedef {MPCameraPosition}
|
|
9
|
-
*/
|
|
10
|
-
export default class MPCameraPosition {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Creates an instance of MPCameraPosition.
|
|
15
|
-
*
|
|
16
|
-
* @constructor
|
|
17
|
-
* @private
|
|
18
|
-
* @param {number} zoom The zoom level of the camera.
|
|
19
|
-
* @param {MPPoint} target The target of the camera.
|
|
20
|
-
* @param {number} tilt The camera's tilt value.
|
|
21
|
-
* @param {number} bearing The camera's heading.
|
|
22
|
-
*/
|
|
23
|
-
public constructor(
|
|
24
|
-
public readonly zoom: number,
|
|
25
|
-
public readonly target: MPPoint,
|
|
26
|
-
public readonly tilt: number,
|
|
27
|
-
public readonly bearing: number,
|
|
28
|
-
) { }
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Creator for MPBuildingCollection, used to decode JSON from the MapsIndoors SDK.
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
* @static
|
|
35
|
-
* @param {MPCameraPositionParams} object
|
|
36
|
-
* @returns {MPCameraPosition}
|
|
37
|
-
*/
|
|
38
|
-
public static create(object: MPCameraPositionParams): MPCameraPosition {
|
|
39
|
-
const target = object.target instanceof MPPoint ? object.target : MPPoint.create(object.target);
|
|
40
|
-
|
|
41
|
-
return new MPCameraPosition(
|
|
42
|
-
object?.zoom,
|
|
43
|
-
target,
|
|
44
|
-
object?.bearing ? object.bearing : 0,
|
|
45
|
-
object?.tilt ? object.tilt : 0,
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Parameter interface for {@link MPCameraPosition}.
|
|
52
|
-
*
|
|
53
|
-
* @export
|
|
54
|
-
* @interface MPCameraPositionParams
|
|
55
|
-
* @typedef {MPCameraPositionParams}
|
|
56
|
-
*/
|
|
57
|
-
export interface MPCameraPositionParams {
|
|
58
|
-
/**
|
|
59
|
-
* The zoom level of the camera.
|
|
60
|
-
*
|
|
61
|
-
* @type {number}
|
|
62
|
-
*/
|
|
63
|
-
zoom: number,
|
|
64
|
-
/**
|
|
65
|
-
* The target of the camera.
|
|
66
|
-
*
|
|
67
|
-
* @type {MPPoint}
|
|
68
|
-
*/
|
|
69
|
-
target: MPPoint | any,
|
|
70
|
-
/**
|
|
71
|
-
* The camera's tilt value.
|
|
72
|
-
*
|
|
73
|
-
* @type {?number}
|
|
74
|
-
*/
|
|
75
|
-
tilt?: number,
|
|
76
|
-
/**
|
|
77
|
-
* The camera's heading.
|
|
78
|
-
*
|
|
79
|
-
* @type {?number}
|
|
80
|
-
*/
|
|
81
|
-
bearing?: number,
|
|
82
|
-
}
|