@mapsindoors/react-native-maps-indoors-mapbox 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +322 -0
  2. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +166 -0
  3. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +1699 -0
  4. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +761 -0
  5. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +410 -0
  6. package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +16 -0
  7. package/android/src/main/java/com/mapsindoorsrn/core/README.md +3 -0
  8. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +227 -0
  9. package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +22 -0
  10. package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +19 -0
  11. package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +77 -0
  12. package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +17 -0
  13. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +34 -0
  14. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +68 -0
  15. package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +38 -0
  16. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +46 -0
  17. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +117 -0
  18. package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +30 -0
  19. package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +35 -0
  20. package/ios/core/CameraPosition.swift +15 -0
  21. package/ios/core/CameraUpdate.swift +19 -0
  22. package/ios/core/CameraUpdateError.swift +11 -0
  23. package/ios/core/DirectionsRendererBridge.m +59 -0
  24. package/ios/core/DirectionsRendererModule.swift +359 -0
  25. package/ios/core/DirectionsServiceBridge.m +55 -0
  26. package/ios/core/DirectionsServiceModule.swift +186 -0
  27. package/ios/core/IconStopUrl.swift +17 -0
  28. package/ios/core/LabelGraphic.swift +15 -0
  29. package/ios/core/MPDisplayRuleBridge.m +696 -0
  30. package/ios/core/MPDisplayRuleModule.swift +1704 -0
  31. package/ios/core/MapControlBridge.m +213 -0
  32. package/ios/core/MapControlModule.swift +702 -0
  33. package/ios/core/MapsIndoorsBridge.m +128 -0
  34. package/ios/core/MapsIndoorsData.swift +288 -0
  35. package/ios/core/MapsIndoorsModule.swift +363 -0
  36. package/ios/core/RCMapView.swift +16 -0
  37. package/ios/core/README.md +3 -0
  38. package/ios/core/ReactPositionProvider.swift +27 -0
  39. package/ios/core/RouteIcon.swift +34 -0
  40. package/ios/core/UtilsBridge.m +73 -0
  41. package/ios/core/UtilsModule.swift +182 -0
  42. package/ios/core/helpers.swift +57 -0
  43. package/package.json +1 -1
  44. package/src/core/EventNames.ts +21 -0
  45. package/src/core/MPAdditionalDetail.ts +102 -0
  46. package/src/core/MPBadgePosition.ts +12 -0
  47. package/src/core/MPBounds.ts +155 -0
  48. package/src/core/MPBuilding.ts +333 -0
  49. package/src/core/MPBuildingCollection.ts +57 -0
  50. package/src/core/MPBuildingInfo.ts +63 -0
  51. package/src/core/MPCameraEvent.ts +17 -0
  52. package/src/core/MPCameraEventListener.ts +17 -0
  53. package/src/core/MPCameraPosition.ts +82 -0
  54. package/src/core/MPCameraUpdate.ts +174 -0
  55. package/src/core/MPCameraViewFitMode.ts +25 -0
  56. package/src/core/MPCategory.ts +85 -0
  57. package/src/core/MPCategoryCollection.ts +62 -0
  58. package/src/core/MPCollection.ts +59 -0
  59. package/src/core/MPCollisionHandling.ts +12 -0
  60. package/src/core/MPDailyOpeningHours.ts +67 -0
  61. package/src/core/MPDataField.ts +69 -0
  62. package/src/core/MPDetailType.ts +73 -0
  63. package/src/core/MPDirectionsRenderer.ts +238 -0
  64. package/src/core/MPDirectionsService.ts +152 -0
  65. package/src/core/MPDisplayRule.ts +1823 -0
  66. package/src/core/MPEntity.ts +60 -0
  67. package/src/core/MPEntityInfo.ts +28 -0
  68. package/src/core/MPError.ts +122 -0
  69. package/src/core/MPFeatureTypes.ts +8 -0
  70. package/src/core/MPFilter.ts +168 -0
  71. package/src/core/MPFilterBehavior.ts +115 -0
  72. package/src/core/MPFloor.ts +170 -0
  73. package/src/core/MPFloorSelectorInterface.ts +63 -0
  74. package/src/core/MPGeometry.ts +91 -0
  75. package/src/core/MPHighlightBehavior.ts +115 -0
  76. package/src/core/MPHighway.ts +14 -0
  77. package/src/core/MPIconPlacement.ts +13 -0
  78. package/src/core/MPIconSize.ts +39 -0
  79. package/src/core/MPLabelGraphic.ts +24 -0
  80. package/src/core/MPLabelPosition.ts +12 -0
  81. package/src/core/MPLabelType.ts +11 -0
  82. package/src/core/MPLocation.ts +440 -0
  83. package/src/core/MPLocationPropertyNames.ts +30 -0
  84. package/src/core/MPLocationSettings.ts +40 -0
  85. package/src/core/MPLocationType.ts +16 -0
  86. package/src/core/MPMapConfig.ts +280 -0
  87. package/src/core/MPMapStyle.ts +57 -0
  88. package/src/core/MPMultiPolygon.ts +218 -0
  89. package/src/core/MPOpeningHours.ts +48 -0
  90. package/src/core/MPPOIType.ts +43 -0
  91. package/src/core/MPPoint.ts +169 -0
  92. package/src/core/MPPolygon.ts +219 -0
  93. package/src/core/MPPositionProviderInterface.ts +45 -0
  94. package/src/core/MPPositionResultInterface.ts +42 -0
  95. package/src/core/MPPropertyData.ts +234 -0
  96. package/src/core/MPQuery.ts +69 -0
  97. package/src/core/MPRoute.ts +105 -0
  98. package/src/core/MPRouteCoordinate.ts +95 -0
  99. package/src/core/MPRouteLeg.ts +158 -0
  100. package/src/core/MPRouteProperty.ts +83 -0
  101. package/src/core/MPRouteStep.ts +186 -0
  102. package/src/core/MPRouteStopIconConfig.ts +82 -0
  103. package/src/core/MPSelectionBehavior.ts +114 -0
  104. package/src/core/MPSelectionMode.ts +4 -0
  105. package/src/core/MPSettings3D.ts +107 -0
  106. package/src/core/MPSize.ts +21 -0
  107. package/src/core/MPSolution.ts +189 -0
  108. package/src/core/MPSolutionConfig.ts +188 -0
  109. package/src/core/MPSolutionDisplayRule.ts +15 -0
  110. package/src/core/MPUserRole.ts +60 -0
  111. package/src/core/MPUserRoleCollection.ts +37 -0
  112. package/src/core/MPUtils.ts +178 -0
  113. package/src/core/MPVenue.ts +294 -0
  114. package/src/core/MPVenueCollection.ts +58 -0
  115. package/src/core/MPVenueInfo.ts +62 -0
  116. package/src/core/MPWeeklyOpeningHours.ts +129 -0
  117. package/src/core/MapControl.ts +961 -0
  118. package/src/core/MapView.tsx +34 -0
  119. package/src/core/MapsIndoors.ts +571 -0
  120. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +17 -0
  121. package/src/core/OnFloorSelectionChangedListener.ts +17 -0
  122. package/src/core/OnFloorUpdateListener.ts +16 -0
  123. package/src/core/OnLegSelectedListener.ts +17 -0
  124. package/src/core/OnLiveLocationUpdateListener.ts +17 -0
  125. package/src/core/OnLocationSelectedListener.ts +17 -0
  126. package/src/core/OnMapClickListener.ts +20 -0
  127. package/src/core/OnMarkerClickListener.ts +17 -0
  128. package/src/core/OnMarkerInfoWindowClickListener.ts +17 -0
  129. package/src/core/OnPositionUpdateListener.ts +17 -0
  130. package/src/core/OnVenueFoundAtCameraTargetListener.ts +17 -0
  131. package/src/core/README.md +3 -0
  132. package/src/core/RouteStopIconConfig.ts +10 -0
@@ -0,0 +1,169 @@
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
+ }
@@ -0,0 +1,219 @@
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
+ }
@@ -0,0 +1,45 @@
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
+ }
@@ -0,0 +1,42 @@
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
+ }
@@ -0,0 +1,234 @@
1
+ import { Platform } from "react-native";
2
+ import { MPPoint, MPDataField, MPPointParams } from "../../index";
3
+ import { MPEntityInfo } from "./MPEntityInfo";
4
+ import MPLocationSettings from "./MPLocationSettings";
5
+ import { MPAdditionalDetail } from "./MPAdditionalDetail";
6
+
7
+ /**
8
+ * Internal - Documentation will follow.
9
+ *
10
+ * @export
11
+ * @class MPPropertyData
12
+ * @typedef {MPPropertyData}
13
+ * @extends {MPEntityInfo}
14
+ */
15
+ export default class MPPropertyData extends MPEntityInfo {
16
+
17
+ /**
18
+ * Creates an instance of MPPropertyData.
19
+ *
20
+ * @constructor
21
+ * @private
22
+ * @param {string} name
23
+ * @param {?string[]} [aliases]
24
+ * @param {?Map<string, MPDataField>} [fields]
25
+ * @param {?Map<string, string>} [categories]
26
+ * @param {?number} [floor]
27
+ * @param {?string} [floorName]
28
+ * @param {?string} [building]
29
+ * @param {?string} [venue]
30
+ * @param {?string} [type]
31
+ * @param {?string} [description]
32
+ * @param {?string} [externalId]
33
+ * @param {?number} [activeFrom]
34
+ * @param {?number} [activeTo]
35
+ * @param {?Map<string, MPDataField>} [contact]
36
+ * @param {?string} [imageUrl]
37
+ * @param {?string} [locationType]
38
+ * @param {?boolean} [bookable]
39
+ * @param {?MPPoint} [anchor]
40
+ * @param {?MPAdditionalDetail[]} [additionalDetails]
41
+ */
42
+ private constructor(
43
+ name: string,
44
+ aliases?: string[],
45
+ fields?: Map<string, MPDataField>,
46
+ readonly categories?: Map<string, string>,
47
+ readonly floor?: number,
48
+ readonly floorName?: string,
49
+ readonly building?: string,
50
+ readonly venue?: string,
51
+ readonly type?: string,
52
+ readonly description?: string,
53
+ readonly externalId?: string,
54
+ readonly activeFrom?: number,
55
+ readonly activeTo?: number,
56
+ readonly contact?: Map<string, MPDataField>,
57
+ readonly imageUrl?: string,
58
+ readonly locationType?: string,
59
+ readonly bookable?: boolean,
60
+ readonly anchor?: MPPoint,
61
+ public locationSettings?: MPLocationSettings,
62
+ readonly additionalDetails?: MPAdditionalDetail[],
63
+ ) { super(name, aliases, fields, undefined) }
64
+
65
+ /**
66
+ * Internal - Documentation will follow.
67
+ *
68
+ * @public
69
+ * @static
70
+ * @param {MPPropertyDataParams} object
71
+ * @returns {MPPropertyData}
72
+ */
73
+ public static create(object: MPPropertyDataParams, id?: string): MPPropertyData {
74
+ var floor;
75
+ if (Platform.OS === 'ios') {
76
+ floor = object?.floor as number;
77
+ }else {
78
+ floor = object?.floor ? parseInt(object?.floor as string) : undefined;
79
+ }
80
+
81
+ return new MPPropertyData(
82
+ object?.name,
83
+ object?.aliases,
84
+ object?.fields,
85
+ object?.categories,
86
+ floor,
87
+ object?.floorName,
88
+ object?.building,
89
+ object?.venue,
90
+ object?.type,
91
+ object?.description,
92
+ object?.externalId,
93
+ object?.activeFrom,
94
+ object?.activeTo,
95
+ object?.contact,
96
+ object?.imageURL,
97
+ object?.locationType,
98
+ object?.bookable,
99
+ MPPoint.create(object?.anchor),
100
+ object?.locationSettings && id ? MPLocationSettings.create(id, object?.locationSettings) : undefined,
101
+ object?.additionalDetails ? object.additionalDetails.map((detail: any) => MPAdditionalDetail.fromJson(detail)) : undefined,
102
+ );
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Internal - Documentation will follow.
108
+ *
109
+ * @export
110
+ * @interface MPPropertyDataParams
111
+ * @typedef {MPPropertyDataParams}
112
+ */
113
+ export interface MPPropertyDataParams {
114
+ /**
115
+ * Internal - Documentation will follow.
116
+ *
117
+ * @type {string}
118
+ */
119
+ name: string,
120
+ /**
121
+ * Internal - Documentation will follow.
122
+ *
123
+ * @type {?string[]}
124
+ */
125
+ aliases?: string[],
126
+ /**
127
+ * Internal - Documentation will follow.
128
+ *
129
+ * @type {?Map<string, MPDataField>}
130
+ */
131
+ fields?: Map<string, MPDataField>,
132
+ /**
133
+ * Internal - Documentation will follow.
134
+ *
135
+ * @type {?Map<string, string>}
136
+ */
137
+ categories?: Map<string, string>,
138
+ /**
139
+ * Internal - Documentation will follow.
140
+ *
141
+ * @type {?string}
142
+ */
143
+ floor?: string | number,
144
+ /**
145
+ * Internal - Documentation will follow.
146
+ *
147
+ * @type {?string}
148
+ */
149
+ floorName?: string,
150
+ /**
151
+ * Internal - Documentation will follow.
152
+ *
153
+ * @type {?string}
154
+ */
155
+ building?: string,
156
+ /**
157
+ * Internal - Documentation will follow.
158
+ *
159
+ * @type {?string}
160
+ */
161
+ venue?: string,
162
+ /**
163
+ * Internal - Documentation will follow.
164
+ *
165
+ * @type {?string}
166
+ */
167
+ type?: string,
168
+ /**
169
+ * Internal - Documentation will follow.
170
+ *
171
+ * @type {?string}
172
+ */
173
+ description?: string,
174
+ /**
175
+ * Internal - Documentation will follow.
176
+ *
177
+ * @type {?string}
178
+ */
179
+ externalId?: string,
180
+ /**
181
+ * Internal - Documentation will follow.
182
+ *
183
+ * @type {?number}
184
+ */
185
+ activeFrom?: number,
186
+ /**
187
+ * Internal - Documentation will follow.
188
+ *
189
+ * @type {?number}
190
+ */
191
+ activeTo?: number,
192
+ /**
193
+ * Internal - Documentation will follow.
194
+ *
195
+ * @type {?Map<string, MPDataField>}
196
+ */
197
+ contact?: Map<string, MPDataField>,
198
+ /**
199
+ * Internal - Documentation will follow.
200
+ *
201
+ * @type {?string}
202
+ */
203
+ imageURL?: string,
204
+ /**
205
+ * Internal - Documentation will follow.
206
+ *
207
+ * @type {?string}
208
+ */
209
+ locationType?: string,
210
+ /**
211
+ * Internal - Documentation will follow.
212
+ *
213
+ * @type {?boolean}
214
+ */
215
+ bookable?: boolean,
216
+ /**
217
+ * Internal - Documentation will follow.
218
+ *
219
+ * @type {?MPPointParams}
220
+ */
221
+ anchor?: MPPointParams,
222
+ /**
223
+ * Internal - Documentation will follow.
224
+ *
225
+ * @type {?MPLocationSettings}
226
+ */
227
+ locationSettings?: MPLocationSettings,
228
+ /**
229
+ * The location's additional details list
230
+ *
231
+ * @type {?any[]}
232
+ */
233
+ additionalDetails?: any[],
234
+ }