@mapsindoors/react-native-maps-indoors-mapbox 0.0.5-beta

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 (147) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +178 -0
  3. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  7. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  8. package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
  9. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  10. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  11. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  12. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  14. package/android/.gradle/7.4/gc.properties +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  17. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  18. package/android/.gradle/file-system.probe +0 -0
  19. package/android/.gradle/vcs-1/gc.properties +0 -0
  20. package/android/.idea/compiler.xml +6 -0
  21. package/android/.idea/gradle.xml +19 -0
  22. package/android/.idea/jarRepositories.xml +45 -0
  23. package/android/.idea/misc.xml +10 -0
  24. package/android/.idea/vcs.xml +6 -0
  25. package/android/README.md +14 -0
  26. package/android/build.gradle +169 -0
  27. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  28. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  29. package/android/gradle.properties +17 -0
  30. package/android/gradlew +234 -0
  31. package/android/gradlew.bat +89 -0
  32. package/android/local.properties +8 -0
  33. package/android/src/main/AndroidManifest.xml +6 -0
  34. package/android/src/main/java/com/reactlibrary/DirectionsRendererModule.java +207 -0
  35. package/android/src/main/java/com/reactlibrary/DirectionsServiceModule.java +130 -0
  36. package/android/src/main/java/com/reactlibrary/MPDisplayRuleModule.java +816 -0
  37. package/android/src/main/java/com/reactlibrary/MapControlModule.java +661 -0
  38. package/android/src/main/java/com/reactlibrary/MapsIndoorsModule.java +327 -0
  39. package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +46 -0
  40. package/android/src/main/java/com/reactlibrary/MapsIndoorsViewManager.java +119 -0
  41. package/android/src/main/java/com/reactlibrary/UtilsModule.java +165 -0
  42. package/android/src/main/java/com/reactlibrary/models/Bounds.java +19 -0
  43. package/android/src/main/java/com/reactlibrary/models/Filter.java +77 -0
  44. package/android/src/main/java/com/reactlibrary/models/Location.java +17 -0
  45. package/android/src/main/java/com/reactlibrary/models/MPCameraPosition.java +29 -0
  46. package/android/src/main/java/com/reactlibrary/models/MPCameraUpdate.java +92 -0
  47. package/android/src/main/java/com/reactlibrary/models/MPError.java +38 -0
  48. package/android/src/main/java/com/reactlibrary/models/PositionProvider.java +46 -0
  49. package/android/src/main/java/com/reactlibrary/models/PositionResult.java +117 -0
  50. package/android/src/main/java/com/reactlibrary/models/Query.java +30 -0
  51. package/android/src/main/res/values/google_maps_api_key.xml +4 -0
  52. package/android/src/main/res/values/mapbox_api_key.xml +5 -0
  53. package/index.ts +184 -0
  54. package/ios/DirectionsRendererBridge.m +53 -0
  55. package/ios/DirectionsRendererModule.swift +187 -0
  56. package/ios/DirectionsServiceBridge.m +46 -0
  57. package/ios/DirectionsServiceModule.swift +149 -0
  58. package/ios/MPDisplayRuleBridge.m +410 -0
  59. package/ios/MPDisplayRuleModule.swift +845 -0
  60. package/ios/MapControlBridge.m +178 -0
  61. package/ios/MapControlModule.swift +602 -0
  62. package/ios/MapsIndoors.xcodeproj/project.pbxproj +318 -0
  63. package/ios/MapsIndoors.xcworkspace/contents.xcworkspacedata +7 -0
  64. package/ios/MapsIndoors.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  65. package/ios/MapsIndoorsBridge.m +98 -0
  66. package/ios/MapsIndoorsData.swift +203 -0
  67. package/ios/MapsIndoorsModule.swift +247 -0
  68. package/ios/MapsIndoorsViewManager.swift +30 -0
  69. package/ios/MapsIndoorsViewManagerBridge.m +9 -0
  70. package/ios/ReactPositionProvider.swift +25 -0
  71. package/ios/UtilsBridge.m +63 -0
  72. package/ios/UtilsModule.swift +146 -0
  73. package/ios/helpers.swift +57 -0
  74. package/ios/react-native-maps-indoors-Bridging-Header.h +6 -0
  75. package/package.json +52 -0
  76. package/react-native-maps-indoors-mapbox.podspec +30 -0
  77. package/src/EventNames.ts +21 -0
  78. package/src/MPBounds.ts +137 -0
  79. package/src/MPBuilding.ts +334 -0
  80. package/src/MPBuildingCollection.ts +57 -0
  81. package/src/MPBuildingInfo.ts +63 -0
  82. package/src/MPCameraEvent.ts +17 -0
  83. package/src/MPCameraEventListener.ts +17 -0
  84. package/src/MPCameraPosition.ts +83 -0
  85. package/src/MPCameraUpdate.ts +174 -0
  86. package/src/MPCameraViewFitMode.ts +21 -0
  87. package/src/MPCategory.ts +76 -0
  88. package/src/MPCategoryCollection.ts +62 -0
  89. package/src/MPCollection.ts +59 -0
  90. package/src/MPCollisionHandling.ts +12 -0
  91. package/src/MPDataField.ts +69 -0
  92. package/src/MPDirectionsRenderer.ts +194 -0
  93. package/src/MPDirectionsService.ts +119 -0
  94. package/src/MPDisplayRule.ts +1027 -0
  95. package/src/MPEntity.ts +60 -0
  96. package/src/MPEntityInfo.ts +28 -0
  97. package/src/MPError.ts +122 -0
  98. package/src/MPFilter.ts +168 -0
  99. package/src/MPFilterBehavior.ts +95 -0
  100. package/src/MPFloor.ts +170 -0
  101. package/src/MPFloorSelectorInterface.ts +63 -0
  102. package/src/MPGeometry.ts +91 -0
  103. package/src/MPHighway.ts +14 -0
  104. package/src/MPIconSize.ts +39 -0
  105. package/src/MPLocation.ts +386 -0
  106. package/src/MPLocationPropertyNames.ts +30 -0
  107. package/src/MPLocationType.ts +16 -0
  108. package/src/MPMapConfig.ts +211 -0
  109. package/src/MPMapStyle.ts +57 -0
  110. package/src/MPMultiPolygon.ts +205 -0
  111. package/src/MPPoint.ts +165 -0
  112. package/src/MPPolygon.ts +206 -0
  113. package/src/MPPositionProviderInterface.ts +45 -0
  114. package/src/MPPositionResultInterface.ts +42 -0
  115. package/src/MPPropertyData.ts +215 -0
  116. package/src/MPQuery.ts +69 -0
  117. package/src/MPRoute.ts +95 -0
  118. package/src/MPRouteCoordinate.ts +95 -0
  119. package/src/MPRouteLeg.ts +128 -0
  120. package/src/MPRouteProperty.ts +83 -0
  121. package/src/MPRouteStep.ts +176 -0
  122. package/src/MPSelectionBehavior.ts +93 -0
  123. package/src/MPSettings3D.ts +107 -0
  124. package/src/MPSize.ts +21 -0
  125. package/src/MPSolution.ts +180 -0
  126. package/src/MPSolutionConfig.ts +127 -0
  127. package/src/MPSolutionDisplayRule.ts +13 -0
  128. package/src/MPUserRole.ts +60 -0
  129. package/src/MPUserRoleCollection.ts +37 -0
  130. package/src/MPUtils.ts +157 -0
  131. package/src/MPVenue.ts +294 -0
  132. package/src/MPVenueCollection.ts +58 -0
  133. package/src/MPVenueInfo.ts +62 -0
  134. package/src/MapControl.ts +861 -0
  135. package/src/MapView.tsx +34 -0
  136. package/src/MapsIndoors.ts +530 -0
  137. package/src/OnBuildingFoundAtCameraTargetListener.ts +17 -0
  138. package/src/OnFloorSelectionChangedListener.ts +17 -0
  139. package/src/OnFloorUpdateListener.ts +16 -0
  140. package/src/OnLegSelectedListener.ts +17 -0
  141. package/src/OnLiveLocationUpdateListener.ts +17 -0
  142. package/src/OnLocationSelectedListener.ts +17 -0
  143. package/src/OnMapClickListener.ts +20 -0
  144. package/src/OnMarkerClickListener.ts +17 -0
  145. package/src/OnMarkerInfoWindowClickListener.ts +17 -0
  146. package/src/OnPositionUpdateListener.ts +17 -0
  147. package/src/OnVenueFoundAtCameraTargetListener.ts +17 -0
@@ -0,0 +1,206 @@
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
+ return this._bounds ??= MPBounds.fromBBox(this._bbox);
99
+ }
100
+
101
+ /**
102
+ * Get the polygon's area.
103
+ *
104
+ * @public
105
+ * @async
106
+ * @returns {Promise<number>}
107
+ */
108
+ public async getArea(): Promise<number> {
109
+ return Promise.resolve(this._area ??= await MPUtils.geometryArea(this));
110
+ }
111
+
112
+ /**
113
+ * Get the position of the polygon, which is roughly its center.
114
+ *
115
+ * @public
116
+ * @readonly
117
+ * @type {MPPoint}
118
+ */
119
+ public get position(): MPPoint {
120
+ return this.bounds.center;
121
+ }
122
+
123
+ /**
124
+ * Get the type of the polygon. see {@link MPGeometry#polygon}
125
+ *
126
+ * @public
127
+ * @readonly
128
+ * @type {string}
129
+ */
130
+ public get type(): string {
131
+ return MPGeometry.polygon;
132
+ }
133
+
134
+
135
+ /**
136
+ * Creator for MPPolygon, used to decode JSON from the MapsIndoors SDK.
137
+ *
138
+ * @public
139
+ * @static
140
+ * @param {MPPolygonParams} object
141
+ * @returns {MPPolygon}
142
+ */
143
+ public static create(object: MPPolygonParams): MPPolygon {
144
+ return new MPPolygon(object?.coordinates, object?.bbox);
145
+ }
146
+
147
+ /**
148
+ * Calculates the squared distance from the point to the closest edge in the polygon.
149
+ *
150
+ * @public
151
+ * @async
152
+ * @param {MPPoint} point
153
+ * @returns {Promise<number>}
154
+ */
155
+ public async distanceToClosestEdge(point: MPPoint): Promise<number> {
156
+ return MPUtils.polygonDistanceToClosestEdge(point, this);
157
+ }
158
+
159
+ /**
160
+ * Clears area and bounds cache due to geometry recalculation.
161
+ *
162
+ * @private
163
+ */
164
+ private clearCache() {
165
+ this._area = undefined;
166
+ this._bounds = undefined;
167
+ }
168
+
169
+
170
+ /**
171
+ * Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
172
+ *
173
+ * @public
174
+ * @returns {MPPolygonParams}
175
+ */
176
+ public toJSON(): MPPolygonParams {
177
+ return {
178
+ "coordinates": this._coordinates,
179
+ "bbox": this._bbox,
180
+ }
181
+ }
182
+ }
183
+
184
+
185
+ /**
186
+ * Parameter interface for {@link MPPolygon}.
187
+ *
188
+ * @export
189
+ * @interface MPPolygonParams
190
+ * @typedef {MPPolygonParams}
191
+ */
192
+ export interface MPPolygonParams {
193
+
194
+ /**
195
+ * Geometry, as specified in the [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.6}.
196
+ *
197
+ * @type {number[][][]}
198
+ */
199
+ coordinates: number[][][],
200
+ /**
201
+ * bounding box, as specified in the [GeoJson format]{@link https://stevage.github.io/geojson-spec/#section-5}.
202
+ *
203
+ * @type {number[]}
204
+ */
205
+ bbox: number[],
206
+ }
@@ -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,215 @@
1
+ import { Platform } from "react-native";
2
+ import { MPPoint, MPDataField, MPPointParams } from "../index";
3
+ import { MPEntityInfo } from "./MPEntityInfo";
4
+
5
+ /**
6
+ * Internal - Documentation will follow.
7
+ *
8
+ * @export
9
+ * @class MPPropertyData
10
+ * @typedef {MPPropertyData}
11
+ * @extends {MPEntityInfo}
12
+ */
13
+ export default class MPPropertyData extends MPEntityInfo {
14
+
15
+ /**
16
+ * Creates an instance of MPPropertyData.
17
+ *
18
+ * @constructor
19
+ * @private
20
+ * @param {string} name
21
+ * @param {?string[]} [aliases]
22
+ * @param {?Map<string, MPDataField>} [fields]
23
+ * @param {?Map<string, string>} [categories]
24
+ * @param {?number} [floor]
25
+ * @param {?string} [floorName]
26
+ * @param {?string} [building]
27
+ * @param {?string} [venue]
28
+ * @param {?string} [type]
29
+ * @param {?string} [description]
30
+ * @param {?string} [externalId]
31
+ * @param {?number} [activeFrom]
32
+ * @param {?number} [activeTo]
33
+ * @param {?Map<string, MPDataField>} [contact]
34
+ * @param {?string} [imageUrl]
35
+ * @param {?string} [locationType]
36
+ * @param {?boolean} [bookable]
37
+ * @param {?MPPoint} [anchor]
38
+ */
39
+ private constructor(
40
+ name: string,
41
+ aliases?: string[],
42
+ fields?: Map<string, MPDataField>,
43
+ readonly categories?: Map<string, string>,
44
+ readonly floor?: number,
45
+ readonly floorName?: string,
46
+ readonly building?: string,
47
+ readonly venue?: string,
48
+ readonly type?: string,
49
+ readonly description?: string,
50
+ readonly externalId?: string,
51
+ readonly activeFrom?: number,
52
+ readonly activeTo?: number,
53
+ readonly contact?: Map<string, MPDataField>,
54
+ readonly imageUrl?: string,
55
+ readonly locationType?: string,
56
+ readonly bookable?: boolean,
57
+ readonly anchor?: MPPoint,
58
+ ) { super(name, aliases, fields, undefined) }
59
+
60
+ /**
61
+ * Internal - Documentation will follow.
62
+ *
63
+ * @public
64
+ * @static
65
+ * @param {MPPropertyDataParams} object
66
+ * @returns {MPPropertyData}
67
+ */
68
+ public static create(object: MPPropertyDataParams): MPPropertyData {
69
+ var floor;
70
+ if (Platform.OS === 'ios') {
71
+ floor = object.floor as number;
72
+ }else {
73
+ floor = object?.floor ? parseInt(object?.floor as string) : undefined;
74
+ }
75
+
76
+ return new MPPropertyData(
77
+ object?.name,
78
+ object?.aliases,
79
+ object?.fields,
80
+ object?.categories,
81
+ floor,
82
+ object?.floorName,
83
+ object?.building,
84
+ object?.venue,
85
+ object?.type,
86
+ object?.description,
87
+ object?.externalId,
88
+ object?.activeFrom,
89
+ object?.activeTo,
90
+ object?.contact,
91
+ object?.imageUrl,
92
+ object?.locationType,
93
+ object?.bookable,
94
+ MPPoint.create(object?.anchor),
95
+ );
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Internal - Documentation will follow.
101
+ *
102
+ * @export
103
+ * @interface MPPropertyDataParams
104
+ * @typedef {MPPropertyDataParams}
105
+ */
106
+ export interface MPPropertyDataParams {
107
+ /**
108
+ * Internal - Documentation will follow.
109
+ *
110
+ * @type {string}
111
+ */
112
+ name: string,
113
+ /**
114
+ * Internal - Documentation will follow.
115
+ *
116
+ * @type {?string[]}
117
+ */
118
+ aliases?: string[],
119
+ /**
120
+ * Internal - Documentation will follow.
121
+ *
122
+ * @type {?Map<string, MPDataField>}
123
+ */
124
+ fields?: Map<string, MPDataField>,
125
+ /**
126
+ * Internal - Documentation will follow.
127
+ *
128
+ * @type {?Map<string, string>}
129
+ */
130
+ categories?: Map<string, string>,
131
+ /**
132
+ * Internal - Documentation will follow.
133
+ *
134
+ * @type {?string}
135
+ */
136
+ floor?: string | number,
137
+ /**
138
+ * Internal - Documentation will follow.
139
+ *
140
+ * @type {?string}
141
+ */
142
+ floorName?: string,
143
+ /**
144
+ * Internal - Documentation will follow.
145
+ *
146
+ * @type {?string}
147
+ */
148
+ building?: string,
149
+ /**
150
+ * Internal - Documentation will follow.
151
+ *
152
+ * @type {?string}
153
+ */
154
+ venue?: string,
155
+ /**
156
+ * Internal - Documentation will follow.
157
+ *
158
+ * @type {?string}
159
+ */
160
+ type?: string,
161
+ /**
162
+ * Internal - Documentation will follow.
163
+ *
164
+ * @type {?string}
165
+ */
166
+ description?: string,
167
+ /**
168
+ * Internal - Documentation will follow.
169
+ *
170
+ * @type {?string}
171
+ */
172
+ externalId?: string,
173
+ /**
174
+ * Internal - Documentation will follow.
175
+ *
176
+ * @type {?number}
177
+ */
178
+ activeFrom?: number,
179
+ /**
180
+ * Internal - Documentation will follow.
181
+ *
182
+ * @type {?number}
183
+ */
184
+ activeTo?: number,
185
+ /**
186
+ * Internal - Documentation will follow.
187
+ *
188
+ * @type {?Map<string, MPDataField>}
189
+ */
190
+ contact?: Map<string, MPDataField>,
191
+ /**
192
+ * Internal - Documentation will follow.
193
+ *
194
+ * @type {?string}
195
+ */
196
+ imageUrl?: string,
197
+ /**
198
+ * Internal - Documentation will follow.
199
+ *
200
+ * @type {?string}
201
+ */
202
+ locationType?: string,
203
+ /**
204
+ * Internal - Documentation will follow.
205
+ *
206
+ * @type {?boolean}
207
+ */
208
+ bookable?: boolean,
209
+ /**
210
+ * Internal - Documentation will follow.
211
+ *
212
+ * @type {?MPPointParams}
213
+ */
214
+ anchor?: MPPointParams,
215
+ }
package/src/MPQuery.ts ADDED
@@ -0,0 +1,69 @@
1
+ import { MPPoint, MPLocationPropertyNames } from "../index";
2
+
3
+ /**
4
+ * A collection of query parameters used to query entities in MapsIndoors.
5
+ *
6
+ * @export
7
+ * @class MPQuery
8
+ * @typedef {MPQuery}
9
+ */
10
+ export default class MPQuery {
11
+
12
+ /**
13
+ * Creates an instance of MPQuery.
14
+ *
15
+ * @constructor
16
+ * @private
17
+ * @param {?string} [query] The queried text (search text).
18
+ * @param {?MPPoint} [near] The query is restricted to entities near this point.
19
+ * @param {?string[]} [queryProperties] A list of properties for this query, Uses {@link MPLocationPropertyNames}.
20
+ */
21
+ private constructor(
22
+ public readonly query?: string,
23
+ public readonly near?: MPPoint,
24
+ public readonly queryProperties?: string[],
25
+ ) { }
26
+
27
+ /**
28
+ * Creator for MPQuery, used to decode JSON from the MapsIndoors SDK.
29
+ *
30
+ * @static
31
+ * @param {?MPQueryParams} [object]
32
+ * @returns {MPQuery}
33
+ */
34
+ static create(object?: MPQueryParams): MPQuery {
35
+ return new MPQuery(
36
+ object?.query,
37
+ object?.near,
38
+ object?.queryProperties
39
+ );
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Parameter interface for {@link MPQuery}.
45
+ *
46
+ * @export
47
+ * @interface MPQueryParams
48
+ * @typedef {MPQueryParams}
49
+ */
50
+ export interface MPQueryParams {
51
+ /**
52
+ * The queried text (search text).
53
+ *
54
+ * @type {?string}
55
+ */
56
+ query?: string,
57
+ /**
58
+ * The query is restricted to entities near this point.
59
+ *
60
+ * @type {?MPPoint}
61
+ */
62
+ near?: MPPoint,
63
+ /**
64
+ * A list of properties for this query, Uses {@link MPLocationPropertyNames}.
65
+ *
66
+ * @type {?string[]}
67
+ */
68
+ queryProperties?: string[],
69
+ }
package/src/MPRoute.ts ADDED
@@ -0,0 +1,95 @@
1
+ import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "../index";
2
+
3
+ /**
4
+ * A route from a origin to a destination broken up into {@link legs}.
5
+ *
6
+ * @export
7
+ * @class MPRoute
8
+ * @typedef {MPRoute}
9
+ */
10
+ export default class MPRoute {
11
+ /**
12
+ * Creates an instance of MPRoute.
13
+ *
14
+ * @constructor
15
+ * @private
16
+ * @param {?MPRouteLeg[]} [legs] The legs the route consists of.
17
+ * @param {?string} [copyrights] The copyrights for this route, if any exists.
18
+ * @param {?string} [summary] A summary of the route.
19
+ * @param {?string[]} [warnings] Any warnings issued for any paths on the route.
20
+ * @param {?string[]} [restrictions] All restrictions in place for the route.
21
+ * @param {?MPBounds} [bounds] The outer bounds of the route.
22
+ */
23
+ private constructor(
24
+ public readonly legs?: MPRouteLeg[],
25
+ public readonly copyrights?: string,
26
+ public readonly summary?: string,
27
+ public readonly warnings?: string[],
28
+ public readonly restrictions?: string[],
29
+ public readonly bounds?: MPBounds,
30
+ ) { }
31
+
32
+ /**
33
+ * Creator for MPRoute, used to decode JSON from the MapsIndoors SDK.
34
+ *
35
+ * @static
36
+ * @param {MPRouteParams} object
37
+ * @returns {MPRoute}
38
+ */
39
+ static create(object: MPRouteParams): MPRoute {
40
+ return new MPRoute(
41
+ object?.legs ? object?.legs.map((leg: any) => MPRouteLeg.create(leg)) : undefined,
42
+ object?.copyrights,
43
+ object?.summary,
44
+ object?.warnings,
45
+ object?.restrictions,
46
+ object?.bounds ? MPBounds.create(object?.bounds) : undefined,
47
+ );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Parameter interface for {@link MPRoute}.
53
+ *
54
+ * @export
55
+ * @interface MPRouteParams
56
+ * @typedef {MPRouteParams}
57
+ */
58
+ export interface MPRouteParams {
59
+ /**
60
+ * The legs the route consists of.
61
+ *
62
+ * @type {?MPRouteLegParams[]}
63
+ */
64
+ legs?: MPRouteLegParams[],
65
+ /**
66
+ * The copyrights for this route, if any exists.
67
+ *
68
+ * @type {?string}
69
+ */
70
+ copyrights?: string,
71
+ /**
72
+ * A summary of the route.
73
+ *
74
+ * @type {?string}
75
+ */
76
+ summary?: string,
77
+ /**
78
+ * Any warnings issued for any paths on the route.
79
+ *
80
+ * @type {?string[]}
81
+ */
82
+ warnings?: string[],
83
+ /**
84
+ * All restrictions in place for the route.
85
+ *
86
+ * @type {?string[]}
87
+ */
88
+ restrictions?: string[],
89
+ /**
90
+ * The outer bounds of the route.
91
+ *
92
+ * @type {?MPBoundsParams}
93
+ */
94
+ bounds?: MPBoundsParams,
95
+ }