@mapsindoors/react-native-maps-indoors-mapbox 2.5.4 → 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 +3 -3
- 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/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 -76
- package/src/core/MPCategoryCollection.ts +0 -62
- package/src/core/MPCollection.ts +0 -59
- package/src/core/MPCollisionHandling.ts +0 -12
- package/src/core/MPDataField.ts +0 -69
- 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 -410
- 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/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 -224
- 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/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/MPPoint.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import MPGeometry from "./MPGeometry";
|
|
2
|
-
import MPUtils from "./MPUtils";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* MPPoint is a representation of {@link latitude} and {@link longitude} coordinates packaged with
|
|
6
|
-
* a Z-axis representation in {@link floorIndex}.
|
|
7
|
-
*
|
|
8
|
-
* @export
|
|
9
|
-
* @class MPPoint
|
|
10
|
-
* @typedef {MPPoint}
|
|
11
|
-
* @extends {MPGeometry}
|
|
12
|
-
*/
|
|
13
|
-
export default class MPPoint extends MPGeometry {
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Latitude coordinate.
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
* @readonly
|
|
20
|
-
* @type {number}
|
|
21
|
-
*/
|
|
22
|
-
public readonly latitude: number;
|
|
23
|
-
/**
|
|
24
|
-
* Longitude coordinate.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
* @readonly
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
public readonly longitude: number;
|
|
31
|
-
/**
|
|
32
|
-
* Optional index that defines what floor this point is placed on.
|
|
33
|
-
*
|
|
34
|
-
* If 0 it is placed on the ground floor, or outside.
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
* @readonly
|
|
38
|
-
* @type {?number}
|
|
39
|
-
*/
|
|
40
|
-
public readonly floorIndex?: number;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Creates an instance of MPPoint.
|
|
44
|
-
*
|
|
45
|
-
* @constructor
|
|
46
|
-
* @public
|
|
47
|
-
* @param {number} latitude The position of the point on the latitudal axis (N/S).
|
|
48
|
-
* @param {number} longitude The position of the point on the longitudal axis (E/W).
|
|
49
|
-
* @param {number} [floorIndex=0] The floor index of the point, Will default to 0 if not provided.
|
|
50
|
-
*/
|
|
51
|
-
public constructor(latitude: number, longitude: number, floorIndex: number = 0) {
|
|
52
|
-
super();
|
|
53
|
-
this.latitude = latitude;
|
|
54
|
-
this.longitude = longitude;
|
|
55
|
-
this.floorIndex = floorIndex;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Creator for MPPoint, used to decode JSON from the MapsIndoors SDK.
|
|
60
|
-
*
|
|
61
|
-
* @public
|
|
62
|
-
* @static
|
|
63
|
-
* @param {MPPointParams} pointParams
|
|
64
|
-
* @returns {MPPoint}
|
|
65
|
-
*/
|
|
66
|
-
public static create(pointParams: MPPointParams): MPPoint {
|
|
67
|
-
if (pointParams?.coordinates) {
|
|
68
|
-
return new MPPoint(pointParams.coordinates[1], pointParams.coordinates[0], pointParams.coordinates[2]);
|
|
69
|
-
} else if (pointParams as unknown as number[]){
|
|
70
|
-
const pp = pointParams as unknown as number[]
|
|
71
|
-
return new MPPoint(pp[1], pp[0], pp[2]);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Calculates the angle between this point and another [MPPoint] in degrees from north.
|
|
77
|
-
*
|
|
78
|
-
* @public
|
|
79
|
-
* @async
|
|
80
|
-
* @param {MPPoint} other
|
|
81
|
-
* @returns {Promise<number>}
|
|
82
|
-
*/
|
|
83
|
-
public async angleBetween(other: MPPoint): Promise<number> {
|
|
84
|
-
return MPUtils.pointAngleBetween(this, other);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Calculates the shortest distance to another point from this point.
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
91
|
-
* @async
|
|
92
|
-
* @param {MPPoint} other
|
|
93
|
-
* @returns {Promise<number>}
|
|
94
|
-
*/
|
|
95
|
-
public async distanceTo(other: MPPoint): Promise<number> {
|
|
96
|
-
return MPUtils.pointDistanceTo(this, other);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* {@link MPGeometry} override, returns this object.
|
|
101
|
-
*
|
|
102
|
-
* @public
|
|
103
|
-
* @readonly
|
|
104
|
-
* @type {MPPoint}
|
|
105
|
-
*/
|
|
106
|
-
public get position(): MPPoint {
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get the type of the point. see {@link MPGeometry#point}.
|
|
112
|
-
*
|
|
113
|
-
* @public
|
|
114
|
-
* @readonly
|
|
115
|
-
* @type {string}
|
|
116
|
-
*/
|
|
117
|
-
public get type(): string {
|
|
118
|
-
return MPGeometry.point;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* {@link MPGeometry} override, resolves to a non-zero value.
|
|
123
|
-
*
|
|
124
|
-
* @public
|
|
125
|
-
* @async
|
|
126
|
-
* @returns {Promise<number>}
|
|
127
|
-
*/
|
|
128
|
-
public async getArea(): Promise<number> {
|
|
129
|
-
return Promise.resolve(0.5);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
135
|
-
*
|
|
136
|
-
* @public
|
|
137
|
-
* @returns {MPPointParams}
|
|
138
|
-
*/
|
|
139
|
-
public toJSON(): MPPointParams {
|
|
140
|
-
return {
|
|
141
|
-
type: this.type,
|
|
142
|
-
coordinates: [this.longitude, this.latitude, this.floorIndex ?? 0],
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Parameter interface for {@link MPPoint}.
|
|
149
|
-
*
|
|
150
|
-
* @export
|
|
151
|
-
* @interface MPPointParams
|
|
152
|
-
* @typedef {MPPointParams}
|
|
153
|
-
*/
|
|
154
|
-
export interface MPPointParams {
|
|
155
|
-
/**
|
|
156
|
-
* the type of the geometry, leave this blank as it is just used to parse the geometry to JSON
|
|
157
|
-
*
|
|
158
|
-
* @type {string}
|
|
159
|
-
*/
|
|
160
|
-
type?: string,
|
|
161
|
-
/**
|
|
162
|
-
* Coordinate holder for point, on the form:.
|
|
163
|
-
*
|
|
164
|
-
* [LNG, LAT, FLOOR]
|
|
165
|
-
*
|
|
166
|
-
* @type {number[]}
|
|
167
|
-
*/
|
|
168
|
-
coordinates: number[],
|
|
169
|
-
}
|
package/src/core/MPPolygon.ts
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { MPPoint, MPGeometry, MPBounds } from "../../index";
|
|
2
|
-
import MPUtils from "./MPUtils";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* MPPolygon is a collection of {@link MPPoint}s that combine
|
|
6
|
-
* to form a single geographical area with a single body.
|
|
7
|
-
*
|
|
8
|
-
* @export
|
|
9
|
-
* @class MPPolygon
|
|
10
|
-
* @typedef {MPPolygon}
|
|
11
|
-
* @extends {MPGeometry}
|
|
12
|
-
*/
|
|
13
|
-
export default class MPPolygon extends MPGeometry {
|
|
14
|
-
/**
|
|
15
|
-
* bounds cache.
|
|
16
|
-
*
|
|
17
|
-
* @private
|
|
18
|
-
* @type {?MPBounds}
|
|
19
|
-
*/
|
|
20
|
-
private _bounds?: MPBounds;
|
|
21
|
-
/**
|
|
22
|
-
* area cache.
|
|
23
|
-
*
|
|
24
|
-
* @private
|
|
25
|
-
* @type {?number}
|
|
26
|
-
*/
|
|
27
|
-
private _area?: number;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Creates an instance of MPPolygon.
|
|
31
|
-
*
|
|
32
|
-
* @constructor
|
|
33
|
-
* @private
|
|
34
|
-
* @param {number[][][]} _coordinates
|
|
35
|
-
* @param {number[]} _bbox
|
|
36
|
-
*/
|
|
37
|
-
private constructor(
|
|
38
|
-
private _coordinates: number[][][],
|
|
39
|
-
private _bbox: number[]
|
|
40
|
-
) {
|
|
41
|
-
super();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Update the polygon's bounding box, the bounding box must be in
|
|
46
|
-
* [GeoJson format]{@link https://stevage.github.io/geojson-spec/#section-5}
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
* @type {{}}
|
|
50
|
-
*/
|
|
51
|
-
public set bbox(box: number[]) {
|
|
52
|
-
this._bbox = box;
|
|
53
|
-
this.clearCache();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Get the polygon's bounding box, the bounding box is in
|
|
58
|
-
* [GeoJson format]{@link https://stevage.github.io/geojson-spec/#section-5}
|
|
59
|
-
*
|
|
60
|
-
* @public
|
|
61
|
-
* @type {number[]}
|
|
62
|
-
*/
|
|
63
|
-
public get bbox(): number[] {
|
|
64
|
-
return this._bbox;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Update the coordinates list for the polygon, the coordinates must be in
|
|
69
|
-
* [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.6}
|
|
70
|
-
*
|
|
71
|
-
* @public
|
|
72
|
-
* @type {number[][][]}
|
|
73
|
-
*/
|
|
74
|
-
public set coordinates(coordinates: number[][][]) {
|
|
75
|
-
this._coordinates = coordinates;
|
|
76
|
-
this.clearCache();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Get the coordinates as a collection in
|
|
81
|
-
* [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.6}.
|
|
82
|
-
*
|
|
83
|
-
* @public
|
|
84
|
-
* @type {number[][][]}
|
|
85
|
-
*/
|
|
86
|
-
public get coordinates(): number[][][] {
|
|
87
|
-
return this._coordinates;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Get the polygon's bounds. If {@link bbox} is present then that will be used.
|
|
92
|
-
*
|
|
93
|
-
* @public
|
|
94
|
-
* @readonly
|
|
95
|
-
* @type {MPBounds}
|
|
96
|
-
*/
|
|
97
|
-
public get bounds(): MPBounds {
|
|
98
|
-
if (this._bounds == undefined) {
|
|
99
|
-
this._bounds = MPBounds.fromBBox(this._bbox)
|
|
100
|
-
}
|
|
101
|
-
return this._bounds;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Get the polygon's area.
|
|
106
|
-
*
|
|
107
|
-
* @public
|
|
108
|
-
* @async
|
|
109
|
-
* @returns {Promise<number>}
|
|
110
|
-
*/
|
|
111
|
-
public async getArea(): Promise<number> {
|
|
112
|
-
if (this._area == undefined) {
|
|
113
|
-
this._area = await MPUtils.geometryArea(this);
|
|
114
|
-
}
|
|
115
|
-
return Promise.resolve(this._area);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Get the position of the polygon, which is roughly its center.
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
* @readonly
|
|
123
|
-
* @type {MPPoint}
|
|
124
|
-
*/
|
|
125
|
-
public get position(): MPPoint {
|
|
126
|
-
return this.bounds.center;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Get the type of the polygon. see {@link MPGeometry#polygon}
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
* @readonly
|
|
134
|
-
* @type {string}
|
|
135
|
-
*/
|
|
136
|
-
public get type(): string {
|
|
137
|
-
return MPGeometry.polygon;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Creator for MPPolygon, used to decode JSON from the MapsIndoors SDK.
|
|
143
|
-
*
|
|
144
|
-
* @public
|
|
145
|
-
* @static
|
|
146
|
-
* @param {MPPolygonParams} object
|
|
147
|
-
* @returns {MPPolygon}
|
|
148
|
-
*/
|
|
149
|
-
public static create(object: MPPolygonParams): MPPolygon {
|
|
150
|
-
return new MPPolygon(object?.coordinates, object?.bbox);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Calculates the squared distance from the point to the closest edge in the polygon.
|
|
155
|
-
*
|
|
156
|
-
* @public
|
|
157
|
-
* @async
|
|
158
|
-
* @param {MPPoint} point
|
|
159
|
-
* @returns {Promise<number>}
|
|
160
|
-
*/
|
|
161
|
-
public async distanceToClosestEdge(point: MPPoint): Promise<number> {
|
|
162
|
-
return MPUtils.polygonDistanceToClosestEdge(point, this);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Clears area and bounds cache due to geometry recalculation.
|
|
167
|
-
*
|
|
168
|
-
* @private
|
|
169
|
-
*/
|
|
170
|
-
private clearCache() {
|
|
171
|
-
this._area = undefined;
|
|
172
|
-
this._bounds = undefined;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
178
|
-
*
|
|
179
|
-
* @public
|
|
180
|
-
* @returns {MPPolygonParams}
|
|
181
|
-
*/
|
|
182
|
-
public toJSON(): MPPolygonParams {
|
|
183
|
-
return {
|
|
184
|
-
type: this.type,
|
|
185
|
-
coordinates: this._coordinates,
|
|
186
|
-
bbox: this._bbox,
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Parameter interface for {@link MPPolygon}.
|
|
194
|
-
*
|
|
195
|
-
* @export
|
|
196
|
-
* @interface MPPolygonParams
|
|
197
|
-
* @typedef {MPPolygonParams}
|
|
198
|
-
*/
|
|
199
|
-
export interface MPPolygonParams {
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* the type of the geometry, leave this blank as it is just used to parse the geometry to JSON
|
|
203
|
-
*
|
|
204
|
-
* @type {string}
|
|
205
|
-
*/
|
|
206
|
-
type?: string,
|
|
207
|
-
/**
|
|
208
|
-
* Geometry, as specified in the [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.6}.
|
|
209
|
-
*
|
|
210
|
-
* @type {number[][][]}
|
|
211
|
-
*/
|
|
212
|
-
coordinates: number[][][],
|
|
213
|
-
/**
|
|
214
|
-
* bounding box, as specified in the [GeoJson format]{@link https://stevage.github.io/geojson-spec/#section-5}.
|
|
215
|
-
*
|
|
216
|
-
* @type {number[]}
|
|
217
|
-
*/
|
|
218
|
-
bbox: number[],
|
|
219
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { OnPositionUpdateListener, MPPositionResultInterface } from "../../index";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interface for added a position provider to the SDK.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @abstract
|
|
8
|
-
* @class MPPositionProviderInterface
|
|
9
|
-
* @typedef {MPPositionProviderInterface}
|
|
10
|
-
*/
|
|
11
|
-
export abstract class MPPositionProviderInterface {
|
|
12
|
-
/**
|
|
13
|
-
* Add a listener to the position provider.
|
|
14
|
-
*
|
|
15
|
-
* The listener should be invoked when a new position has been received.
|
|
16
|
-
*
|
|
17
|
-
* @abstract
|
|
18
|
-
* @param {OnPositionUpdateListener} listener
|
|
19
|
-
*/
|
|
20
|
-
abstract addOnPositionUpdateListener(listener: OnPositionUpdateListener): void;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Remove a listener.
|
|
24
|
-
*
|
|
25
|
-
* @abstract
|
|
26
|
-
* @param {OnPositionUpdateListener} listener
|
|
27
|
-
*/
|
|
28
|
-
abstract removeOnPositionUpdateListener(listener: OnPositionUpdateListener): void;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Invoked when the latest valid position is needed.
|
|
32
|
-
*
|
|
33
|
-
* @abstract
|
|
34
|
-
* @returns {(MPPositionResultInterface | undefined)}
|
|
35
|
-
*/
|
|
36
|
-
abstract getLatestPosition(): MPPositionResultInterface | undefined;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The name of the position provider, used to identify it.
|
|
40
|
-
*
|
|
41
|
-
* @abstract
|
|
42
|
-
* @returns {string}
|
|
43
|
-
*/
|
|
44
|
-
abstract get name(): string;
|
|
45
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { MPPoint } from "../../index";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interface to deliver a position result to the MapsIndoors SDK.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @abstract
|
|
8
|
-
* @class MPPositionResultInterface
|
|
9
|
-
* @typedef {MPPositionResultInterface}
|
|
10
|
-
*/
|
|
11
|
-
export abstract class MPPositionResultInterface {
|
|
12
|
-
/**
|
|
13
|
-
* The position in world space.
|
|
14
|
-
*
|
|
15
|
-
* @type {!MPPoint}
|
|
16
|
-
*/
|
|
17
|
-
point!: MPPoint;
|
|
18
|
-
/**
|
|
19
|
-
* The floor the position is on.
|
|
20
|
-
*
|
|
21
|
-
* @type {?number}
|
|
22
|
-
*/
|
|
23
|
-
floorIndex?: number;
|
|
24
|
-
/**
|
|
25
|
-
* The bearing the position is pointing.
|
|
26
|
-
*
|
|
27
|
-
* @type {?number}
|
|
28
|
-
*/
|
|
29
|
-
bearing?: number;
|
|
30
|
-
/**
|
|
31
|
-
* The accuracy of the position in meters.
|
|
32
|
-
*
|
|
33
|
-
* @type {?number}
|
|
34
|
-
*/
|
|
35
|
-
accuracy?: number;
|
|
36
|
-
/**
|
|
37
|
-
* What position provider delivered the position result.
|
|
38
|
-
*
|
|
39
|
-
* @type {!string}
|
|
40
|
-
*/
|
|
41
|
-
positionProvider!: string;
|
|
42
|
-
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { Platform } from "react-native";
|
|
2
|
-
import { MPPoint, MPDataField, MPPointParams } from "../../index";
|
|
3
|
-
import { MPEntityInfo } from "./MPEntityInfo";
|
|
4
|
-
import MPLocationSettings from "./MPLocationSettings";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal - Documentation will follow.
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
|
-
* @class MPPropertyData
|
|
11
|
-
* @typedef {MPPropertyData}
|
|
12
|
-
* @extends {MPEntityInfo}
|
|
13
|
-
*/
|
|
14
|
-
export default class MPPropertyData extends MPEntityInfo {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Creates an instance of MPPropertyData.
|
|
18
|
-
*
|
|
19
|
-
* @constructor
|
|
20
|
-
* @private
|
|
21
|
-
* @param {string} name
|
|
22
|
-
* @param {?string[]} [aliases]
|
|
23
|
-
* @param {?Map<string, MPDataField>} [fields]
|
|
24
|
-
* @param {?Map<string, string>} [categories]
|
|
25
|
-
* @param {?number} [floor]
|
|
26
|
-
* @param {?string} [floorName]
|
|
27
|
-
* @param {?string} [building]
|
|
28
|
-
* @param {?string} [venue]
|
|
29
|
-
* @param {?string} [type]
|
|
30
|
-
* @param {?string} [description]
|
|
31
|
-
* @param {?string} [externalId]
|
|
32
|
-
* @param {?number} [activeFrom]
|
|
33
|
-
* @param {?number} [activeTo]
|
|
34
|
-
* @param {?Map<string, MPDataField>} [contact]
|
|
35
|
-
* @param {?string} [imageUrl]
|
|
36
|
-
* @param {?string} [locationType]
|
|
37
|
-
* @param {?boolean} [bookable]
|
|
38
|
-
* @param {?MPPoint} [anchor]
|
|
39
|
-
*/
|
|
40
|
-
private constructor(
|
|
41
|
-
name: string,
|
|
42
|
-
aliases?: string[],
|
|
43
|
-
fields?: Map<string, MPDataField>,
|
|
44
|
-
readonly categories?: Map<string, string>,
|
|
45
|
-
readonly floor?: number,
|
|
46
|
-
readonly floorName?: string,
|
|
47
|
-
readonly building?: string,
|
|
48
|
-
readonly venue?: string,
|
|
49
|
-
readonly type?: string,
|
|
50
|
-
readonly description?: string,
|
|
51
|
-
readonly externalId?: string,
|
|
52
|
-
readonly activeFrom?: number,
|
|
53
|
-
readonly activeTo?: number,
|
|
54
|
-
readonly contact?: Map<string, MPDataField>,
|
|
55
|
-
readonly imageUrl?: string,
|
|
56
|
-
readonly locationType?: string,
|
|
57
|
-
readonly bookable?: boolean,
|
|
58
|
-
readonly anchor?: MPPoint,
|
|
59
|
-
public locationSettings?: MPLocationSettings,
|
|
60
|
-
) { super(name, aliases, fields, undefined) }
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Internal - Documentation will follow.
|
|
64
|
-
*
|
|
65
|
-
* @public
|
|
66
|
-
* @static
|
|
67
|
-
* @param {MPPropertyDataParams} object
|
|
68
|
-
* @returns {MPPropertyData}
|
|
69
|
-
*/
|
|
70
|
-
public static create(object: MPPropertyDataParams, id?: string): MPPropertyData {
|
|
71
|
-
var floor;
|
|
72
|
-
if (Platform.OS === 'ios') {
|
|
73
|
-
floor = object?.floor as number;
|
|
74
|
-
}else {
|
|
75
|
-
floor = object?.floor ? parseInt(object?.floor as string) : undefined;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return new MPPropertyData(
|
|
79
|
-
object?.name,
|
|
80
|
-
object?.aliases,
|
|
81
|
-
object?.fields,
|
|
82
|
-
object?.categories,
|
|
83
|
-
floor,
|
|
84
|
-
object?.floorName,
|
|
85
|
-
object?.building,
|
|
86
|
-
object?.venue,
|
|
87
|
-
object?.type,
|
|
88
|
-
object?.description,
|
|
89
|
-
object?.externalId,
|
|
90
|
-
object?.activeFrom,
|
|
91
|
-
object?.activeTo,
|
|
92
|
-
object?.contact,
|
|
93
|
-
object?.imageURL,
|
|
94
|
-
object?.locationType,
|
|
95
|
-
object?.bookable,
|
|
96
|
-
MPPoint.create(object?.anchor),
|
|
97
|
-
object?.locationSettings && id ? MPLocationSettings.create(id, object?.locationSettings) : undefined,
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Internal - Documentation will follow.
|
|
104
|
-
*
|
|
105
|
-
* @export
|
|
106
|
-
* @interface MPPropertyDataParams
|
|
107
|
-
* @typedef {MPPropertyDataParams}
|
|
108
|
-
*/
|
|
109
|
-
export interface MPPropertyDataParams {
|
|
110
|
-
/**
|
|
111
|
-
* Internal - Documentation will follow.
|
|
112
|
-
*
|
|
113
|
-
* @type {string}
|
|
114
|
-
*/
|
|
115
|
-
name: string,
|
|
116
|
-
/**
|
|
117
|
-
* Internal - Documentation will follow.
|
|
118
|
-
*
|
|
119
|
-
* @type {?string[]}
|
|
120
|
-
*/
|
|
121
|
-
aliases?: string[],
|
|
122
|
-
/**
|
|
123
|
-
* Internal - Documentation will follow.
|
|
124
|
-
*
|
|
125
|
-
* @type {?Map<string, MPDataField>}
|
|
126
|
-
*/
|
|
127
|
-
fields?: Map<string, MPDataField>,
|
|
128
|
-
/**
|
|
129
|
-
* Internal - Documentation will follow.
|
|
130
|
-
*
|
|
131
|
-
* @type {?Map<string, string>}
|
|
132
|
-
*/
|
|
133
|
-
categories?: Map<string, string>,
|
|
134
|
-
/**
|
|
135
|
-
* Internal - Documentation will follow.
|
|
136
|
-
*
|
|
137
|
-
* @type {?string}
|
|
138
|
-
*/
|
|
139
|
-
floor?: string | number,
|
|
140
|
-
/**
|
|
141
|
-
* Internal - Documentation will follow.
|
|
142
|
-
*
|
|
143
|
-
* @type {?string}
|
|
144
|
-
*/
|
|
145
|
-
floorName?: string,
|
|
146
|
-
/**
|
|
147
|
-
* Internal - Documentation will follow.
|
|
148
|
-
*
|
|
149
|
-
* @type {?string}
|
|
150
|
-
*/
|
|
151
|
-
building?: string,
|
|
152
|
-
/**
|
|
153
|
-
* Internal - Documentation will follow.
|
|
154
|
-
*
|
|
155
|
-
* @type {?string}
|
|
156
|
-
*/
|
|
157
|
-
venue?: string,
|
|
158
|
-
/**
|
|
159
|
-
* Internal - Documentation will follow.
|
|
160
|
-
*
|
|
161
|
-
* @type {?string}
|
|
162
|
-
*/
|
|
163
|
-
type?: string,
|
|
164
|
-
/**
|
|
165
|
-
* Internal - Documentation will follow.
|
|
166
|
-
*
|
|
167
|
-
* @type {?string}
|
|
168
|
-
*/
|
|
169
|
-
description?: string,
|
|
170
|
-
/**
|
|
171
|
-
* Internal - Documentation will follow.
|
|
172
|
-
*
|
|
173
|
-
* @type {?string}
|
|
174
|
-
*/
|
|
175
|
-
externalId?: string,
|
|
176
|
-
/**
|
|
177
|
-
* Internal - Documentation will follow.
|
|
178
|
-
*
|
|
179
|
-
* @type {?number}
|
|
180
|
-
*/
|
|
181
|
-
activeFrom?: number,
|
|
182
|
-
/**
|
|
183
|
-
* Internal - Documentation will follow.
|
|
184
|
-
*
|
|
185
|
-
* @type {?number}
|
|
186
|
-
*/
|
|
187
|
-
activeTo?: number,
|
|
188
|
-
/**
|
|
189
|
-
* Internal - Documentation will follow.
|
|
190
|
-
*
|
|
191
|
-
* @type {?Map<string, MPDataField>}
|
|
192
|
-
*/
|
|
193
|
-
contact?: Map<string, MPDataField>,
|
|
194
|
-
/**
|
|
195
|
-
* Internal - Documentation will follow.
|
|
196
|
-
*
|
|
197
|
-
* @type {?string}
|
|
198
|
-
*/
|
|
199
|
-
imageURL?: string,
|
|
200
|
-
/**
|
|
201
|
-
* Internal - Documentation will follow.
|
|
202
|
-
*
|
|
203
|
-
* @type {?string}
|
|
204
|
-
*/
|
|
205
|
-
locationType?: string,
|
|
206
|
-
/**
|
|
207
|
-
* Internal - Documentation will follow.
|
|
208
|
-
*
|
|
209
|
-
* @type {?boolean}
|
|
210
|
-
*/
|
|
211
|
-
bookable?: boolean,
|
|
212
|
-
/**
|
|
213
|
-
* Internal - Documentation will follow.
|
|
214
|
-
*
|
|
215
|
-
* @type {?MPPointParams}
|
|
216
|
-
*/
|
|
217
|
-
anchor?: MPPointParams,
|
|
218
|
-
/**
|
|
219
|
-
* Internal - Documentation will follow.
|
|
220
|
-
*
|
|
221
|
-
* @type {?MPLocationSettings}
|
|
222
|
-
*/
|
|
223
|
-
locationSettings?: MPLocationSettings,
|
|
224
|
-
}
|