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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +10 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/reactlibrary/MapboxMapView.java +112 -0
  4. package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +7 -2
  5. package/android/src/main/java/com/reactlibrary/{DirectionsRendererModule.java → core/DirectionsRendererModule.java} +3 -2
  6. package/android/src/main/java/com/reactlibrary/{DirectionsServiceModule.java → core/DirectionsServiceModule.java} +1 -1
  7. package/android/src/main/java/com/reactlibrary/{MPDisplayRuleModule.java → core/MPDisplayRuleModule.java} +2 -2
  8. package/android/src/main/java/com/reactlibrary/{MapControlModule.java → core/MapControlModule.java} +16 -57
  9. package/android/src/main/java/com/reactlibrary/{MapsIndoorsModule.java → core/MapsIndoorsModule.java} +6 -6
  10. package/android/src/main/java/com/reactlibrary/core/RCMapView.java +16 -0
  11. package/android/src/main/java/com/reactlibrary/core/README.md +3 -0
  12. package/android/src/main/java/com/reactlibrary/{UtilsModule.java → core/UtilsModule.java} +2 -2
  13. package/android/src/main/java/com/reactlibrary/{models → core/models}/Bounds.java +1 -1
  14. package/android/src/main/java/com/reactlibrary/{models → core/models}/Filter.java +1 -1
  15. package/android/src/main/java/com/reactlibrary/{models → core/models}/Location.java +1 -1
  16. package/android/src/main/java/com/reactlibrary/{models → core/models}/MPCameraPosition.java +12 -7
  17. package/android/src/main/java/com/reactlibrary/core/models/MPCameraUpdate.java +68 -0
  18. package/android/src/main/java/com/reactlibrary/{models → core/models}/MPError.java +1 -1
  19. package/android/src/main/java/com/reactlibrary/{models → core/models}/PositionProvider.java +1 -1
  20. package/android/src/main/java/com/reactlibrary/{models → core/models}/PositionResult.java +1 -1
  21. package/android/src/main/java/com/reactlibrary/{models → core/models}/Query.java +1 -1
  22. package/index.ts +88 -89
  23. package/ios/MapsIndoorsViewManager.swift +88 -9
  24. package/ios/core/CameraPosition.swift +15 -0
  25. package/ios/core/CameraUpdate.swift +19 -0
  26. package/ios/core/CameraUpdateError.swift +11 -0
  27. package/ios/{DirectionsRendererBridge.m → core/DirectionsRendererBridge.m} +1 -1
  28. package/ios/{DirectionsRendererModule.swift → core/DirectionsRendererModule.swift} +17 -7
  29. package/ios/{MapControlModule.swift → core/MapControlModule.swift} +10 -100
  30. package/ios/{MapsIndoorsBridge.m → core/MapsIndoorsBridge.m} +18 -0
  31. package/ios/{MapsIndoorsData.swift → core/MapsIndoorsData.swift} +2 -2
  32. package/ios/{MapsIndoorsModule.swift → core/MapsIndoorsModule.swift} +50 -1
  33. package/ios/core/RCMapView.swift +14 -0
  34. package/ios/core/README.md +4 -0
  35. package/ios/{UtilsModule.swift → core/UtilsModule.swift} +4 -4
  36. package/package.json +6 -5
  37. package/react-native-maps-indoors-mapbox.podspec +2 -2
  38. package/src/{MPBounds.ts → core/MPBounds.ts} +12 -4
  39. package/src/{MPBuilding.ts → core/MPBuilding.ts} +1 -1
  40. package/src/{MPCameraEvent.ts → core/MPCameraEvent.ts} +1 -1
  41. package/src/{MPCameraEventListener.ts → core/MPCameraEventListener.ts} +1 -1
  42. package/src/{MPCameraPosition.ts → core/MPCameraPosition.ts} +0 -1
  43. package/src/{MPCategory.ts → core/MPCategory.ts} +1 -1
  44. package/src/{MPDirectionsRenderer.ts → core/MPDirectionsRenderer.ts} +4 -4
  45. package/src/{MPDirectionsService.ts → core/MPDirectionsService.ts} +1 -1
  46. package/src/{MPDisplayRule.ts → core/MPDisplayRule.ts} +1 -1
  47. package/src/{MPEntity.ts → core/MPEntity.ts} +1 -1
  48. package/src/{MPEntityInfo.ts → core/MPEntityInfo.ts} +1 -1
  49. package/src/{MPFilter.ts → core/MPFilter.ts} +1 -1
  50. package/src/{MPFilterBehavior.ts → core/MPFilterBehavior.ts} +1 -1
  51. package/src/{MPFloor.ts → core/MPFloor.ts} +1 -1
  52. package/src/{MPFloorSelectorInterface.ts → core/MPFloorSelectorInterface.ts} +1 -1
  53. package/src/{MPLocation.ts → core/MPLocation.ts} +1 -1
  54. package/src/{MPMapConfig.ts → core/MPMapConfig.ts} +1 -1
  55. package/src/{MPMultiPolygon.ts → core/MPMultiPolygon.ts} +1 -1
  56. package/src/{MPPoint.ts → core/MPPoint.ts} +5 -6
  57. package/src/{MPPolygon.ts → core/MPPolygon.ts} +1 -1
  58. package/src/{MPPositionProviderInterface.ts → core/MPPositionProviderInterface.ts} +1 -1
  59. package/src/{MPPositionResultInterface.ts → core/MPPositionResultInterface.ts} +1 -1
  60. package/src/{MPPropertyData.ts → core/MPPropertyData.ts} +1 -1
  61. package/src/{MPQuery.ts → core/MPQuery.ts} +1 -1
  62. package/src/{MPRoute.ts → core/MPRoute.ts} +1 -1
  63. package/src/{MPRouteCoordinate.ts → core/MPRouteCoordinate.ts} +1 -1
  64. package/src/{MPRouteLeg.ts → core/MPRouteLeg.ts} +1 -1
  65. package/src/{MPRouteStep.ts → core/MPRouteStep.ts} +1 -1
  66. package/src/{MPSelectionBehavior.ts → core/MPSelectionBehavior.ts} +1 -1
  67. package/src/{MPSettings3D.ts → core/MPSettings3D.ts} +1 -1
  68. package/src/{MPSolution.ts → core/MPSolution.ts} +1 -1
  69. package/src/{MPSolutionConfig.ts → core/MPSolutionConfig.ts} +1 -1
  70. package/src/{MPSolutionDisplayRule.ts → core/MPSolutionDisplayRule.ts} +1 -1
  71. package/src/{MPUserRoleCollection.ts → core/MPUserRoleCollection.ts} +1 -1
  72. package/src/{MPUtils.ts → core/MPUtils.ts} +1 -1
  73. package/src/{MPVenue.ts → core/MPVenue.ts} +1 -1
  74. package/src/{MapControl.ts → core/MapControl.ts} +1 -1
  75. package/src/{MapsIndoors.ts → core/MapsIndoors.ts} +1 -1
  76. package/src/{OnBuildingFoundAtCameraTargetListener.ts → core/OnBuildingFoundAtCameraTargetListener.ts} +1 -1
  77. package/src/{OnFloorSelectionChangedListener.ts → core/OnFloorSelectionChangedListener.ts} +1 -1
  78. package/src/{OnLegSelectedListener.ts → core/OnLegSelectedListener.ts} +1 -1
  79. package/src/{OnLocationSelectedListener.ts → core/OnLocationSelectedListener.ts} +1 -1
  80. package/src/{OnMapClickListener.ts → core/OnMapClickListener.ts} +1 -1
  81. package/src/{OnMarkerClickListener.ts → core/OnMarkerClickListener.ts} +1 -1
  82. package/src/{OnMarkerInfoWindowClickListener.ts → core/OnMarkerInfoWindowClickListener.ts} +1 -1
  83. package/src/{OnPositionUpdateListener.ts → core/OnPositionUpdateListener.ts} +1 -1
  84. package/src/{OnVenueFoundAtCameraTargetListener.ts → core/OnVenueFoundAtCameraTargetListener.ts} +1 -1
  85. package/src/core/README.md +4 -0
  86. package/android/src/main/java/com/reactlibrary/models/MPCameraUpdate.java +0 -92
  87. /package/ios/{DirectionsServiceBridge.m → core/DirectionsServiceBridge.m} +0 -0
  88. /package/ios/{DirectionsServiceModule.swift → core/DirectionsServiceModule.swift} +0 -0
  89. /package/ios/{MPDisplayRuleBridge.m → core/MPDisplayRuleBridge.m} +0 -0
  90. /package/ios/{MPDisplayRuleModule.swift → core/MPDisplayRuleModule.swift} +0 -0
  91. /package/ios/{MapControlBridge.m → core/MapControlBridge.m} +0 -0
  92. /package/ios/{ReactPositionProvider.swift → core/ReactPositionProvider.swift} +0 -0
  93. /package/ios/{UtilsBridge.m → core/UtilsBridge.m} +0 -0
  94. /package/ios/{helpers.swift → core/helpers.swift} +0 -0
  95. /package/src/{EventNames.ts → core/EventNames.ts} +0 -0
  96. /package/src/{MPBuildingCollection.ts → core/MPBuildingCollection.ts} +0 -0
  97. /package/src/{MPBuildingInfo.ts → core/MPBuildingInfo.ts} +0 -0
  98. /package/src/{MPCameraUpdate.ts → core/MPCameraUpdate.ts} +0 -0
  99. /package/src/{MPCameraViewFitMode.ts → core/MPCameraViewFitMode.ts} +0 -0
  100. /package/src/{MPCategoryCollection.ts → core/MPCategoryCollection.ts} +0 -0
  101. /package/src/{MPCollection.ts → core/MPCollection.ts} +0 -0
  102. /package/src/{MPCollisionHandling.ts → core/MPCollisionHandling.ts} +0 -0
  103. /package/src/{MPDataField.ts → core/MPDataField.ts} +0 -0
  104. /package/src/{MPError.ts → core/MPError.ts} +0 -0
  105. /package/src/{MPGeometry.ts → core/MPGeometry.ts} +0 -0
  106. /package/src/{MPHighway.ts → core/MPHighway.ts} +0 -0
  107. /package/src/{MPIconSize.ts → core/MPIconSize.ts} +0 -0
  108. /package/src/{MPLocationPropertyNames.ts → core/MPLocationPropertyNames.ts} +0 -0
  109. /package/src/{MPLocationType.ts → core/MPLocationType.ts} +0 -0
  110. /package/src/{MPMapStyle.ts → core/MPMapStyle.ts} +0 -0
  111. /package/src/{MPRouteProperty.ts → core/MPRouteProperty.ts} +0 -0
  112. /package/src/{MPSize.ts → core/MPSize.ts} +0 -0
  113. /package/src/{MPUserRole.ts → core/MPUserRole.ts} +0 -0
  114. /package/src/{MPVenueCollection.ts → core/MPVenueCollection.ts} +0 -0
  115. /package/src/{MPVenueInfo.ts → core/MPVenueInfo.ts} +0 -0
  116. /package/src/{MapView.tsx → core/MapView.tsx} +0 -0
  117. /package/src/{OnFloorUpdateListener.ts → core/OnFloorUpdateListener.ts} +0 -0
  118. /package/src/{OnLiveLocationUpdateListener.ts → core/OnLiveLocationUpdateListener.ts} +0 -0
@@ -1,7 +1,6 @@
1
1
  import MapsIndoors
2
2
  import MapsIndoorsCore
3
3
  import MapsIndoorsCodable
4
- import MapboxMaps
5
4
  import React
6
5
 
7
6
  protocol LiveDataDelegate {
@@ -11,8 +10,9 @@ protocol LiveDataDelegate {
11
10
  class MapsIndoorsData {
12
11
  public static var sharedInstance = MapsIndoorsData()
13
12
 
14
- public var mapView: MapView?
13
+ public var mapView: RCMapView?
15
14
  public var mapControl: MPMapControl?
15
+ public var isInitialized: Bool = false
16
16
 
17
17
  var mapControlListenerDelegate: MapControlDelegate?
18
18
  var floorSelector: FloorSelector?
@@ -23,6 +23,7 @@ public class MapsIndoorsModule: NSObject {
23
23
  Task {
24
24
  do {
25
25
  try await MPMapsIndoors.shared.load(apiKey: apiKey)
26
+ MapsIndoorsData.sharedInstance.isInitialized = true
26
27
  return resolve([])
27
28
  } catch let e /*as MPError*/ {
28
29
  return doReject(reject, error: e)
@@ -181,7 +182,6 @@ public class MapsIndoorsModule: NSObject {
181
182
 
182
183
  positionProvider = provider
183
184
  MapsIndoorsData.sharedInstance.mapControl?.positionProvider = positionProvider
184
- // TODO: Do we need to store a reference both places?
185
185
 
186
186
  return resolve(nil)
187
187
  }
@@ -243,5 +243,54 @@ public class MapsIndoorsModule: NSObject {
243
243
 
244
244
  return resolve(MPMapsIndoors.shared.ready)
245
245
  }
246
+
247
+ @objc public func getDefaultVenue(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
248
+ Task {
249
+ guard let defaultVenue = await MPMapsIndoors.shared.venues().first else {
250
+ return reject("1", "no venues exist. Make sure MapsIndoors is ready", nil)
251
+ }
252
+ return resolve(toJSON(MPVenueCodable(withVenue: defaultVenue)))
253
+ }
254
+ }
255
+
256
+ @objc public func checkOfflineDataAvailability(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
257
+ Task {
258
+ guard let key = MPMapsIndoors.shared.apiKey else {
259
+ return reject("1", "isApiKeyValid: API key not set", nil)
260
+ }
261
+
262
+ return resolve(await MPMapsIndoors.shared.isOfflineDataAvailable(apiKey: key))
263
+ }
264
+ }
265
+
266
+ @objc public func destroy(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
267
+ Task {
268
+ MPMapsIndoors.shared.shutdown()
269
+ MapsIndoorsData.sharedInstance.isInitialized = false
270
+ return resolve(nil)
271
+ }
272
+ }
273
+
274
+ @objc public func isInitialized(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
275
+ return resolve(MapsIndoorsData.sharedInstance.isInitialized)
276
+ }
277
+
278
+ @objc public func setLanguage(_ language: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
279
+
280
+ MPMapsIndoors.shared.language = language
281
+ return resolve(nil)
282
+ }
283
+
284
+ @objc public func synchronizeContent(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
285
+ Task {
286
+ do {
287
+ try await MPMapsIndoors.shared.synchronize()
288
+ return resolve(nil)
289
+ }
290
+ catch let e {
291
+ return doReject(reject, error: e)
292
+ }
293
+ }
294
+ }
246
295
 
247
296
  }
@@ -0,0 +1,14 @@
1
+ //
2
+ // RCMapView.swift
3
+ // react-native-maps-indoors-mapbox
4
+ //
5
+ // Created by Tim Mikkelsen on 14/06/2023.
6
+ //
7
+
8
+ import MapsIndoors
9
+
10
+ protocol RCMapView {
11
+ func animateCamera(cameraUpdate: CameraUpdate, duration: Int) throws
12
+ func moveCamera(cameraUpdate: CameraUpdate) throws
13
+ func getConfig() -> MPMapConfig
14
+ }
@@ -0,0 +1,4 @@
1
+ # react-native-mapsindoors-core-ios
2
+
3
+
4
+ iOS core logic for react native mapsindoors sdk
@@ -134,13 +134,13 @@ public class UtilsModule: NSObject {
134
134
  return resolve(nil)
135
135
  }
136
136
 
137
- @objc public func setExtrusionOpacity(_ opcaity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
138
- //TODO: Awaiting iOS 4.1.0
137
+ @objc public func setExtrusionOpacity(_ opacity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
138
+ MPMapsIndoors.shared.solution?.config.settings3D.extrusionOpacity = opacity
139
139
  return resolve(nil)
140
140
  }
141
141
 
142
- @objc public func setWallOpacity(_ opcaity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
143
- //TODO: Awaiting iOS 4.1.0
142
+ @objc public func setWallOpacity(_ opacity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
143
+ MPMapsIndoors.shared.solution?.config.settings3D.wallOpacity = opacity
144
144
  return resolve(nil)
145
145
  }
146
146
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapsindoors/react-native-maps-indoors-mapbox",
3
3
  "title": "React Native MapsIndoors Mapbox",
4
- "version": "0.0.5-beta",
4
+ "version": "1.0.0",
5
5
  "description": "React Native MapsIndoors component with mapbox",
6
6
  "react-native": "index.ts",
7
7
  "files": [
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/github_account/react-native-maps-indoors.git",
22
- "baseUrl": "https://github.com/github_account/react-native-maps-indoors"
21
+ "url": "git+https://github.com/MapsPeople/react-native-mapsindoors-mapbox.git",
22
+ "baseUrl": "https://github.com/MapsPeople/react-native-mapsindoors-mapbox"
23
23
  },
24
24
  "keywords": [
25
25
  "react-native",
@@ -41,12 +41,13 @@
41
41
  "@tsconfig/react-native": "^3.0.2",
42
42
  "@types/jest": "^29.5.2",
43
43
  "@types/react": "^18.2.9",
44
- "@types/react-native": "^0.72.2",
45
44
  "@types/react-dom": "18.2.0",
45
+ "@types/react-native": "^0.72.2",
46
46
  "@types/react-test-renderer": "^18.0.0",
47
+ "typedoc": "^0.24.8",
47
48
  "typescript": "^5.0.4"
48
49
  },
49
50
  "bugs": {
50
- "url": "https://github.com/github_account/react-native-maps-indoors/issues"
51
+ "url": "https://github.com/MapsPeople/react-native-mapsindoors-mapbox/issues"
51
52
  }
52
53
  }
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
24
24
  s.requires_arc = true
25
25
 
26
26
  s.dependency "React"
27
- s.dependency "MapsIndoorsMapbox", "4.1.3"
28
- s.dependency "MapsIndoorsCodable", "4.1.3"
27
+ s.dependency "MapsIndoorsMapbox", "4.2.1"
28
+ s.dependency "MapsIndoorsCodable", "4.2.1"
29
29
  end
30
30
 
@@ -32,10 +32,18 @@ export default class MPBounds {
32
32
  * @returns {MPBounds}
33
33
  */
34
34
  public static create(object: MPBoundsParams): MPBounds {
35
- return new MPBounds(
36
- object.northeast,
37
- object.southwest,
38
- );
35
+ var bounds;
36
+ if ((object as any).northeast.lat != null) {
37
+ var northeast = new MPPoint((object as any).northeast.lat, (object as any).northeast.lng, (object as any).northeast.zLevel);
38
+ var southwest = new MPPoint((object as any).southwest.lat, (object as any).southwest.lng, (object as any).southwest.zLevel);
39
+ bounds = new MPBounds(northeast, southwest)
40
+ }else {
41
+ bounds = new MPBounds(
42
+ object.northeast,
43
+ object.southwest,
44
+ );
45
+ }
46
+ return bounds
39
47
  }
40
48
 
41
49
  /**
@@ -1,5 +1,5 @@
1
1
  import MPEntity from "./MPEntity";
2
- import { MPPoint, MPPolygon, MPFloor, MPBounds, MPDataField, MPPointParams, MPFloorParams } from "../index";
2
+ import { MPPoint, MPPolygon, MPFloor, MPBounds, MPDataField, MPPointParams, MPFloorParams } from "../../index";
3
3
  import MPBuildingInfo, { MPBuildingInfoParams } from "./MPBuildingInfo";
4
4
  import { Platform } from "react-native";
5
5
 
@@ -1,4 +1,4 @@
1
- import MPCameraEventListener from "../index"
1
+ import MPCameraEventListener from "../../index"
2
2
 
3
3
  /**
4
4
  * Possible events that a {@link MPCameraEventListener} can recieve.
@@ -1,4 +1,4 @@
1
- import { MPCameraEvent } from "../index";
1
+ import { MPCameraEvent } from "../../index";
2
2
 
3
3
  /**
4
4
  * Listens for camera events, eg. when the Camera starts or stops moving.
@@ -1,4 +1,3 @@
1
- import { Platform } from "react-native";
2
1
  import MPPoint from "./MPPoint";
3
2
 
4
3
  /**
@@ -1,4 +1,4 @@
1
- import { MPDataField } from "../index";
1
+ import { MPDataField } from "../../index";
2
2
 
3
3
  /**
4
4
  * A category which contains a number of fields
@@ -1,5 +1,5 @@
1
1
  import { EmitterSubscription, NativeEventEmitter, NativeModules } from 'react-native';
2
- import { MPCameraViewFitMode, MPError, MPRoute, OnLegSelectedListener } from "../index";
2
+ import { MPCameraViewFitMode, MPError, MPRoute, OnLegSelectedListener } from "../../index";
3
3
  import { EventNames } from './EventNames';
4
4
 
5
5
  const { DirectionsRenderer } = NativeModules;
@@ -83,7 +83,7 @@ export default class MPDirectionsRenderer {
83
83
  * @param {?MPRoute} [route]
84
84
  * @returns {Promise<void>}
85
85
  */
86
- public async setRoute(route?: MPRoute): Promise<void> {
86
+ public async setRoute(route: MPRoute): Promise<void> {
87
87
  await DirectionsRenderer.setRoute(JSON.stringify(route))
88
88
  }
89
89
 
@@ -111,8 +111,8 @@ export default class MPDirectionsRenderer {
111
111
  * @param {number} legIndex
112
112
  * @returns {Promise<void>}
113
113
  */
114
- public async selectLegindex(legIndex: number): Promise<void> {
115
- await DirectionsRenderer.selectLegindex(legIndex).catch((err: Error) => {
114
+ public async selectLegIndex(legIndex: number): Promise<void> {
115
+ await DirectionsRenderer.selectLegIndex(legIndex).catch((err: Error) => {
116
116
  return Promise.reject(MPError.create(JSON.parse(err.message)));
117
117
  });
118
118
  }
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPError, MPPoint, MPRoute, MPHighway } from "../index";
2
+ import { MPError, MPPoint, MPRoute, MPHighway } from "../../index";
3
3
 
4
4
  const { DirectionsService } = NativeModules;
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPError, MPIconSize } from "../index";
2
+ import { MPError, MPIconSize } from "../../index";
3
3
  const { DisplayRule } = NativeModules;
4
4
 
5
5
 
@@ -1,4 +1,4 @@
1
- import { MPPoint } from "../index";
1
+ import { MPPoint } from "../../index";
2
2
 
3
3
  /**
4
4
  * An interface describing trivial properties of a MapsIndoors geographical entities.
@@ -1,4 +1,4 @@
1
- import { MPDataField } from "../index";
1
+ import { MPDataField } from "../../index";
2
2
 
3
3
  /**
4
4
  * An interface describing base properties of entity info collections.
@@ -1,4 +1,4 @@
1
- import { MPBounds, MPLocation } from "../index";
1
+ import { MPBounds, MPLocation } from "../../index";
2
2
 
3
3
  /**
4
4
  * A filter that can be applied during search, this will limit the returned {@link MPEntity}s to those that
@@ -1,4 +1,4 @@
1
- import MapControl from "../index";
1
+ import MapControl from "../../index";
2
2
 
3
3
  /**
4
4
  * Sets a behavior for the map when calling {@link MapControl#setFilter}.
@@ -1,5 +1,5 @@
1
1
  import MPEntity from "./MPEntity";
2
- import { MPMultiPolygon, MPMultiPolygonParams, MPBounds, MPPoint, MPBuilding } from "../index";
2
+ import { MPMultiPolygon, MPMultiPolygonParams, MPBounds, MPPoint, MPBuilding } from "../../index";
3
3
  import { Platform } from "react-native";
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { MPFloor, OnFloorSelectionChangedListener } from "../index";
1
+ import { MPFloor, OnFloorSelectionChangedListener } from "../../index";
2
2
 
3
3
  /**
4
4
  * Interface used by MapsIndoors to communicate with floor selector UIs.
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPGeometry, MPPoint, MPPolygon, MPBuilding, MPVenue, MPMultiPolygon, MPBounds, MPLocationType, MPLocationPropertyNames } from "../index";
2
+ import { MPGeometry, MPPoint, MPPolygon, MPBuilding, MPVenue, MPMultiPolygon, MPBounds, MPLocationType, MPLocationPropertyNames } from "../../index";
3
3
  import MPEntity from "./MPEntity";
4
4
  import MPPropertyData from "./MPPropertyData";
5
5
 
@@ -1,4 +1,4 @@
1
- import { MPFloorSelectorInterface, MapControl } from "../index";
1
+ import { MPFloorSelectorInterface, MapControl } from "../../index";
2
2
 
3
3
  /**
4
4
  * This configuration object is used when creating a new {@link MapControl} instance.
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPGeometry, MPPolygon, MPBounds } from "../index";
1
+ import { MPPoint, MPGeometry, MPPolygon, MPBounds } from "../../index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,8 +1,6 @@
1
1
  import MPGeometry from "./MPGeometry";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
- var firstTimeWarned = false
5
-
6
4
  /**
7
5
  * MPPoint is a representation of {@link latitude} and {@link longitude} coordinates packaged with
8
6
  * a Z-axis representation in {@link floorIndex}.
@@ -32,7 +30,7 @@ export default class MPPoint extends MPGeometry {
32
30
  public readonly longitude: number;
33
31
  /**
34
32
  * Optional index that defines what floor this point is placed on.
35
- *
33
+ *
36
34
  * If 0 it is placed on the ground floor, or outside.
37
35
  *
38
36
  * @public
@@ -69,7 +67,8 @@ export default class MPPoint extends MPGeometry {
69
67
  if (pointParams?.coordinates) {
70
68
  return new MPPoint(pointParams.coordinates[1], pointParams.coordinates[0], pointParams.coordinates[2]);
71
69
  } else if (pointParams as unknown as number[]){
72
- return new MPPoint((pointParams as unknown as number[])[0], (pointParams as unknown as number[])[1], (pointParams as unknown as number[])[2]);
70
+ const pp = pointParams as unknown as number[]
71
+ return new MPPoint(pp[1], pp[0], pp[2]);
73
72
  }else {
74
73
  return null;
75
74
  }
@@ -156,10 +155,10 @@ export default class MPPoint extends MPGeometry {
156
155
  export interface MPPointParams {
157
156
  /**
158
157
  * Coordinate holder for point, on the form:.
159
- *
158
+ *
160
159
  * [LNG, LAT, FLOOR]
161
160
  *
162
161
  * @type {number[]}
163
162
  */
164
163
  coordinates: number[],
165
- }
164
+ }
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPGeometry, MPBounds } from "../index";
1
+ import { MPPoint, MPGeometry, MPBounds } from "../../index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { OnPositionUpdateListener, MPPositionResultInterface } from "../index";
1
+ import { OnPositionUpdateListener, MPPositionResultInterface } from "../../index";
2
2
 
3
3
  /**
4
4
  * Interface for added a position provider to the SDK.
@@ -1,4 +1,4 @@
1
- import { MPPoint } from "../index";
1
+ import { MPPoint } from "../../index";
2
2
 
3
3
  /**
4
4
  * Interface to deliver a position result to the MapsIndoors SDK.
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPPoint, MPDataField, MPPointParams } from "../index";
2
+ import { MPPoint, MPDataField, MPPointParams } from "../../index";
3
3
  import { MPEntityInfo } from "./MPEntityInfo";
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPLocationPropertyNames } from "../index";
1
+ import { MPPoint, MPLocationPropertyNames } from "../../index";
2
2
 
3
3
  /**
4
4
  * A collection of query parameters used to query entities in MapsIndoors.
@@ -1,4 +1,4 @@
1
- import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "../index";
1
+ import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "../../index";
2
2
 
3
3
  /**
4
4
  * A route from a origin to a destination broken up into {@link legs}.
@@ -1,4 +1,4 @@
1
- import MPRouteStep from "../index";
1
+ import MPRouteStep from "../../index";
2
2
 
3
3
  /**
4
4
  * A coordinate used for routing, it is contained within a {@link MPRouteStep}.
@@ -1,4 +1,4 @@
1
- import { MPRouteStep, MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams, MPRoute } from "../index";
1
+ import { MPRouteStep, MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams, MPRoute } from "../../index";
2
2
 
3
3
  /**
4
4
  * A leg of a {@link MPRoute} is defined as all steps between any context shifts (entering/exiting buildings, changing floors).
@@ -1,4 +1,4 @@
1
- import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "../index";
1
+ import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "../../index";
2
2
 
3
3
  /**
4
4
  * Description placeholder.
@@ -1,4 +1,4 @@
1
- import MapControl from "../index";
1
+ import MapControl from "../../index";
2
2
 
3
3
  /**
4
4
  * Sets a behavior for the map when calling {@link MapControl#selectLocation}.
@@ -1,5 +1,5 @@
1
1
  import MPUtils from "./MPUtils";
2
- import { MPSolutionConfig } from "../index"
2
+ import { MPSolutionConfig } from "../../index"
3
3
 
4
4
  /**
5
5
  * A configuration object that governs layer settings for 3D features.
@@ -1,4 +1,4 @@
1
- import { MPSolutionConfig } from "../index";
1
+ import { MPSolutionConfig } from "../../index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { MPCollisionHandling, MPSettings3D } from "../index";
1
+ import { MPCollisionHandling, MPSettings3D } from "../../index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { MPDisplayRule } from "../index";
1
+ import { MPDisplayRule } from "../../index";
2
2
 
3
3
  /**
4
4
  * Special {@link MPDisplayRule}s that govern specific scenarios
@@ -1,5 +1,5 @@
1
1
  import MPCollection from "./MPCollection";
2
- import MapsIndoors, {MPUserRole} from "../index";
2
+ import MapsIndoors, {MPUserRole} from "../../index";
3
3
 
4
4
  /**
5
5
  * A collection of user role objects fetched from {@link MapsIndoors}. Uses {@link MPUserRole.id} as key.
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPGeometry, MPPoint, MPCollisionHandling } from '../index';
2
+ import { MPGeometry, MPPoint, MPCollisionHandling } from '../../index';
3
3
  const { UtilsModule } = NativeModules;
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPPoint, MPPointParams, MPBounds, MPMapStyle, MPPolygon, MPVenueInfo, MPDataField, MPBuilding, MPLocation } from '../index';
2
+ import { MPPoint, MPPointParams, MPBounds, MPMapStyle, MPPolygon, MPVenueInfo, MPDataField, MPBuilding, MPLocation } from '../../index';
3
3
  import MPEntity from "./MPEntity";
4
4
  import MPUtils from "./MPUtils";
5
5
 
@@ -7,7 +7,7 @@ import {
7
7
  OnVenueFoundAtCameraTargetListener, OnBuildingFoundAtCameraTargetListener,
8
8
  OnMarkerClickListener, OnMarkerInfoWindowClickListener,
9
9
  OnLiveLocationUpdateListener, MPCameraEvent, MPMapStyle, MPCameraUpdate, MPCameraPosition, MPEntity,
10
- } from "../index"
10
+ } from "../../index"
11
11
  import { EventNames } from './EventNames';
12
12
 
13
13
 
@@ -4,7 +4,7 @@ import {
4
4
  MPLocation, MPSolution, MPVenue, MPQuery, MPFilter,
5
5
  MPDisplayRule, MPSolutionDisplayRule, MPPositionProviderInterface,
6
6
  MPPositionResultInterface, MPUserRole, MPError, MPCategoryCollection, MPUserRoleCollection
7
- } from "../index";
7
+ } from "../../index";
8
8
  import MPBuildingCollection from './MPBuildingCollection';
9
9
  import MPVenueCollection from './MPVenueCollection';
10
10
 
@@ -1,4 +1,4 @@
1
- import { MPBuilding } from '../index';
1
+ import { MPBuilding } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when focus changes to a new building within the camera bounds.
@@ -1,4 +1,4 @@
1
- import { MPFloor } from '../index';
1
+ import { MPFloor } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when the active floor is changed.
@@ -1,4 +1,4 @@
1
- import {MPRouteLeg} from '../index';
1
+ import {MPRouteLeg} from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked during directions when a {@link MPRouteLeg} is selected.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../index';
1
+ import { MPLocation } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a {@link MPLocation} is selected.
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPLocation } from '../index';
1
+ import { MPPoint, MPLocation } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when the map is clicked.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../index';
1
+ import { MPLocation } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a {@link MPLocation} marker is clicked on the map.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../index';
1
+ import { MPLocation } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a markers infowindow is clicked.
@@ -1,4 +1,4 @@
1
- import { MPPositionResultInterface } from '../index';
1
+ import { MPPositionResultInterface } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when user positioning is updated.
@@ -1,4 +1,4 @@
1
- import { MPVenue } from '../index';
1
+ import { MPVenue } from '../../index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when focus changes to a new venue within the camera bounds.
@@ -0,0 +1,4 @@
1
+ # react-native-mapsindoors-core
2
+
3
+
4
+ Core logic for react native mapsindoors sdk