@mapsindoors/react-native-maps-indoors-mapbox 0.0.5-beta → 1.0.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.
Files changed (127) hide show
  1. package/README.md +7 -2
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  8. package/android/.idea/jarRepositories.xml +15 -0
  9. package/android/.idea/misc.xml +1 -1
  10. package/android/.idea/vcs.xml +2 -1
  11. package/android/build.gradle +2 -5
  12. package/android/src/main/java/com/reactlibrary/MapboxMapView.java +116 -0
  13. package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +9 -2
  14. package/android/src/main/java/com/reactlibrary/{DirectionsRendererModule.java → core/DirectionsRendererModule.java} +3 -2
  15. package/android/src/main/java/com/reactlibrary/{DirectionsServiceModule.java → core/DirectionsServiceModule.java} +1 -1
  16. package/android/src/main/java/com/reactlibrary/{MPDisplayRuleModule.java → core/MPDisplayRuleModule.java} +3 -3
  17. package/android/src/main/java/com/reactlibrary/{MapControlModule.java → core/MapControlModule.java} +31 -64
  18. package/android/src/main/java/com/reactlibrary/{MapsIndoorsModule.java → core/MapsIndoorsModule.java} +6 -6
  19. package/android/src/main/java/com/reactlibrary/core/RCMapView.java +16 -0
  20. package/android/src/main/java/com/reactlibrary/core/README.md +92 -0
  21. package/android/src/main/java/com/reactlibrary/{UtilsModule.java → core/UtilsModule.java} +13 -12
  22. package/android/src/main/java/com/reactlibrary/{models → core/models}/Bounds.java +1 -1
  23. package/android/src/main/java/com/reactlibrary/{models → core/models}/Filter.java +1 -1
  24. package/android/src/main/java/com/reactlibrary/{models → core/models}/Location.java +1 -1
  25. package/android/src/main/java/com/reactlibrary/{models → core/models}/MPCameraPosition.java +12 -7
  26. package/android/src/main/java/com/reactlibrary/core/models/MPCameraUpdate.java +68 -0
  27. package/android/src/main/java/com/reactlibrary/{models → core/models}/MPError.java +1 -1
  28. package/android/src/main/java/com/reactlibrary/{models → core/models}/PositionProvider.java +1 -1
  29. package/android/src/main/java/com/reactlibrary/{models → core/models}/PositionResult.java +1 -1
  30. package/android/src/main/java/com/reactlibrary/{models → core/models}/Query.java +1 -1
  31. package/index.ts +88 -89
  32. package/ios/MapsIndoorsViewManager.swift +90 -9
  33. package/ios/core/CameraPosition.swift +15 -0
  34. package/ios/core/CameraUpdate.swift +19 -0
  35. package/ios/core/CameraUpdateError.swift +11 -0
  36. package/ios/{DirectionsRendererBridge.m → core/DirectionsRendererBridge.m} +9 -5
  37. package/ios/{DirectionsRendererModule.swift → core/DirectionsRendererModule.swift} +89 -39
  38. package/ios/{MapControlModule.swift → core/MapControlModule.swift} +21 -108
  39. package/ios/{MapsIndoorsBridge.m → core/MapsIndoorsBridge.m} +18 -0
  40. package/ios/{MapsIndoorsData.swift → core/MapsIndoorsData.swift} +19 -4
  41. package/ios/{MapsIndoorsModule.swift → core/MapsIndoorsModule.swift} +50 -1
  42. package/ios/core/RCMapView.swift +14 -0
  43. package/ios/core/README.md +92 -0
  44. package/ios/{UtilsModule.swift → core/UtilsModule.swift} +4 -4
  45. package/package.json +6 -5
  46. package/react-native-maps-indoors-mapbox.podspec +2 -2
  47. package/src/{MPBounds.ts → core/MPBounds.ts} +25 -7
  48. package/src/{MPBuilding.ts → core/MPBuilding.ts} +4 -4
  49. package/src/{MPCameraEvent.ts → core/MPCameraEvent.ts} +1 -1
  50. package/src/{MPCameraEventListener.ts → core/MPCameraEventListener.ts} +1 -1
  51. package/src/{MPCameraPosition.ts → core/MPCameraPosition.ts} +2 -3
  52. package/src/{MPCategory.ts → core/MPCategory.ts} +1 -1
  53. package/src/{MPDirectionsRenderer.ts → core/MPDirectionsRenderer.ts} +4 -4
  54. package/src/{MPDirectionsService.ts → core/MPDirectionsService.ts} +1 -1
  55. package/src/{MPDisplayRule.ts → core/MPDisplayRule.ts} +1 -1
  56. package/src/{MPEntity.ts → core/MPEntity.ts} +1 -1
  57. package/src/{MPEntityInfo.ts → core/MPEntityInfo.ts} +1 -1
  58. package/src/{MPFilter.ts → core/MPFilter.ts} +1 -1
  59. package/src/{MPFilterBehavior.ts → core/MPFilterBehavior.ts} +6 -6
  60. package/src/{MPFloor.ts → core/MPFloor.ts} +1 -1
  61. package/src/{MPFloorSelectorInterface.ts → core/MPFloorSelectorInterface.ts} +1 -1
  62. package/src/{MPLocation.ts → core/MPLocation.ts} +3 -3
  63. package/src/{MPMapConfig.ts → core/MPMapConfig.ts} +1 -1
  64. package/src/{MPMultiPolygon.ts → core/MPMultiPolygon.ts} +18 -5
  65. package/src/{MPPoint.ts → core/MPPoint.ts} +14 -10
  66. package/src/{MPPolygon.ts → core/MPPolygon.ts} +18 -5
  67. package/src/{MPPositionProviderInterface.ts → core/MPPositionProviderInterface.ts} +1 -1
  68. package/src/{MPPositionResultInterface.ts → core/MPPositionResultInterface.ts} +1 -1
  69. package/src/{MPPropertyData.ts → core/MPPropertyData.ts} +2 -2
  70. package/src/{MPQuery.ts → core/MPQuery.ts} +1 -1
  71. package/src/{MPRoute.ts → core/MPRoute.ts} +1 -1
  72. package/src/{MPRouteCoordinate.ts → core/MPRouteCoordinate.ts} +1 -1
  73. package/src/{MPRouteLeg.ts → core/MPRouteLeg.ts} +1 -1
  74. package/src/{MPRouteStep.ts → core/MPRouteStep.ts} +1 -1
  75. package/src/{MPSelectionBehavior.ts → core/MPSelectionBehavior.ts} +6 -6
  76. package/src/{MPSettings3D.ts → core/MPSettings3D.ts} +1 -1
  77. package/src/{MPSolution.ts → core/MPSolution.ts} +1 -1
  78. package/src/{MPSolutionConfig.ts → core/MPSolutionConfig.ts} +3 -3
  79. package/src/{MPSolutionDisplayRule.ts → core/MPSolutionDisplayRule.ts} +1 -1
  80. package/src/{MPUserRoleCollection.ts → core/MPUserRoleCollection.ts} +1 -1
  81. package/src/{MPUtils.ts → core/MPUtils.ts} +1 -1
  82. package/src/{MPVenue.ts → core/MPVenue.ts} +1 -1
  83. package/src/{MapControl.ts → core/MapControl.ts} +5 -2
  84. package/src/{MapsIndoors.ts → core/MapsIndoors.ts} +1 -1
  85. package/src/{OnBuildingFoundAtCameraTargetListener.ts → core/OnBuildingFoundAtCameraTargetListener.ts} +1 -1
  86. package/src/{OnFloorSelectionChangedListener.ts → core/OnFloorSelectionChangedListener.ts} +1 -1
  87. package/src/{OnLegSelectedListener.ts → core/OnLegSelectedListener.ts} +1 -1
  88. package/src/{OnLocationSelectedListener.ts → core/OnLocationSelectedListener.ts} +1 -1
  89. package/src/{OnMapClickListener.ts → core/OnMapClickListener.ts} +1 -1
  90. package/src/{OnMarkerClickListener.ts → core/OnMarkerClickListener.ts} +1 -1
  91. package/src/{OnMarkerInfoWindowClickListener.ts → core/OnMarkerInfoWindowClickListener.ts} +1 -1
  92. package/src/{OnPositionUpdateListener.ts → core/OnPositionUpdateListener.ts} +1 -1
  93. package/src/{OnVenueFoundAtCameraTargetListener.ts → core/OnVenueFoundAtCameraTargetListener.ts} +1 -1
  94. package/src/core/README.md +92 -0
  95. package/android/src/main/java/com/reactlibrary/models/MPCameraUpdate.java +0 -92
  96. /package/ios/{DirectionsServiceBridge.m → core/DirectionsServiceBridge.m} +0 -0
  97. /package/ios/{DirectionsServiceModule.swift → core/DirectionsServiceModule.swift} +0 -0
  98. /package/ios/{MPDisplayRuleBridge.m → core/MPDisplayRuleBridge.m} +0 -0
  99. /package/ios/{MPDisplayRuleModule.swift → core/MPDisplayRuleModule.swift} +0 -0
  100. /package/ios/{MapControlBridge.m → core/MapControlBridge.m} +0 -0
  101. /package/ios/{ReactPositionProvider.swift → core/ReactPositionProvider.swift} +0 -0
  102. /package/ios/{UtilsBridge.m → core/UtilsBridge.m} +0 -0
  103. /package/ios/{helpers.swift → core/helpers.swift} +0 -0
  104. /package/src/{EventNames.ts → core/EventNames.ts} +0 -0
  105. /package/src/{MPBuildingCollection.ts → core/MPBuildingCollection.ts} +0 -0
  106. /package/src/{MPBuildingInfo.ts → core/MPBuildingInfo.ts} +0 -0
  107. /package/src/{MPCameraUpdate.ts → core/MPCameraUpdate.ts} +0 -0
  108. /package/src/{MPCameraViewFitMode.ts → core/MPCameraViewFitMode.ts} +0 -0
  109. /package/src/{MPCategoryCollection.ts → core/MPCategoryCollection.ts} +0 -0
  110. /package/src/{MPCollection.ts → core/MPCollection.ts} +0 -0
  111. /package/src/{MPCollisionHandling.ts → core/MPCollisionHandling.ts} +0 -0
  112. /package/src/{MPDataField.ts → core/MPDataField.ts} +0 -0
  113. /package/src/{MPError.ts → core/MPError.ts} +0 -0
  114. /package/src/{MPGeometry.ts → core/MPGeometry.ts} +0 -0
  115. /package/src/{MPHighway.ts → core/MPHighway.ts} +0 -0
  116. /package/src/{MPIconSize.ts → core/MPIconSize.ts} +0 -0
  117. /package/src/{MPLocationPropertyNames.ts → core/MPLocationPropertyNames.ts} +0 -0
  118. /package/src/{MPLocationType.ts → core/MPLocationType.ts} +0 -0
  119. /package/src/{MPMapStyle.ts → core/MPMapStyle.ts} +0 -0
  120. /package/src/{MPRouteProperty.ts → core/MPRouteProperty.ts} +0 -0
  121. /package/src/{MPSize.ts → core/MPSize.ts} +0 -0
  122. /package/src/{MPUserRole.ts → core/MPUserRole.ts} +0 -0
  123. /package/src/{MPVenueCollection.ts → core/MPVenueCollection.ts} +0 -0
  124. /package/src/{MPVenueInfo.ts → core/MPVenueInfo.ts} +0 -0
  125. /package/src/{MapView.tsx → core/MapView.tsx} +0 -0
  126. /package/src/{OnFloorUpdateListener.ts → core/OnFloorUpdateListener.ts} +0 -0
  127. /package/src/{OnLiveLocationUpdateListener.ts → core/OnLiveLocationUpdateListener.ts} +0 -0
@@ -0,0 +1,92 @@
1
+ # react-native-mapsindoors-core-ios
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://git.rtx.mapspeople.com/timi/react-native-mapsindoors-core-ios.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://git.rtx.mapspeople.com/timi/react-native-mapsindoors-core-ios/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
53
+
54
+ ## Name
55
+ Choose a self-explaining name for your project.
56
+
57
+ ## Description
58
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
59
+
60
+ ## Badges
61
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
62
+
63
+ ## Visuals
64
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
65
+
66
+ ## Installation
67
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
68
+
69
+ ## Usage
70
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
71
+
72
+ ## Support
73
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
74
+
75
+ ## Roadmap
76
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
77
+
78
+ ## Contributing
79
+ State if you are open to contributions and what your requirements are for accepting them.
80
+
81
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
82
+
83
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
84
+
85
+ ## Authors and acknowledgment
86
+ Show your appreciation to those who have contributed to the project.
87
+
88
+ ## License
89
+ For open source projects, say how it is licensed.
90
+
91
+ ## Project status
92
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -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.1",
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.2"
28
+ s.dependency "MapsIndoorsCodable", "4.2.2"
29
29
  end
30
30
 
@@ -1,4 +1,5 @@
1
1
  import MPPoint from "./MPPoint";
2
+ import { Platform } from "react-native";
2
3
 
3
4
  /**
4
5
  * A simple representation of a bounding box.
@@ -32,10 +33,18 @@ export default class MPBounds {
32
33
  * @returns {MPBounds}
33
34
  */
34
35
  public static create(object: MPBoundsParams): MPBounds {
35
- return new MPBounds(
36
- object.northeast,
37
- object.southwest,
38
- );
36
+ var bounds;
37
+ if ((object as any).northeast.lat != null) {
38
+ var northeast = new MPPoint((object as any).northeast.lat, (object as any).northeast.lng, (object as any).northeast.zLevel);
39
+ var southwest = new MPPoint((object as any).southwest.lat, (object as any).southwest.lng, (object as any).southwest.zLevel);
40
+ bounds = new MPBounds(northeast, southwest)
41
+ }else {
42
+ bounds = new MPBounds(
43
+ object.northeast,
44
+ object.southwest,
45
+ );
46
+ }
47
+ return bounds
39
48
  }
40
49
 
41
50
  /**
@@ -79,10 +88,19 @@ export default class MPBounds {
79
88
  ((point.longitude <= this.northeast.longitude &&
80
89
  point.longitude >= this.southwest.longitude));
81
90
  }
91
+
92
+
82
93
  public toJSON() {
83
- return {
84
- "northeast": [this.northeast.longitude, this.northeast.latitude],
85
- "southwest": [this.southwest.longitude, this.southwest.latitude]
94
+ if(Platform.OS === 'ios') {
95
+ return {
96
+ "northeast": [this.northeast.longitude, this.northeast.latitude],
97
+ "southwest": [this.southwest.longitude, this.southwest.latitude],
98
+ }
99
+ } else {
100
+ return {
101
+ "northeast": this.northeast,
102
+ "southwest": this.southwest,
103
+ }
86
104
  }
87
105
  }
88
106
 
@@ -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
 
@@ -138,7 +138,7 @@ export default class MPBuilding extends MPEntity {
138
138
  * @type {string}
139
139
  */
140
140
  public get name(): string {
141
- return this.buildingInfo?.name ?? "";
141
+ return this.buildingInfo?.name ? this.buildingInfo.name : "";
142
142
  }
143
143
 
144
144
  /**
@@ -149,7 +149,7 @@ export default class MPBuilding extends MPEntity {
149
149
  * @type {string[]}
150
150
  */
151
151
  public get aliases(): string[] {
152
- return this.buildingInfo?.aliases ?? [];
152
+ return this.buildingInfo?.aliases ? this.buildingInfo.aliases : [];
153
153
  }
154
154
 
155
155
  /**
@@ -182,7 +182,7 @@ export default class MPBuilding extends MPEntity {
182
182
  * @type {number}
183
183
  */
184
184
  public get initialFloorIndex(): number {
185
- return this.defaultFloor ?? this.floors[0].floorIndex ?? 0;
185
+ return this.defaultFloor ? this.defaultFloor : this.floors[0].floorIndex ? this.floors[0].floorIndex : 0;
186
186
  }
187
187
 
188
188
  /**
@@ -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
  /**
@@ -42,8 +41,8 @@ export default class MPCameraPosition {
42
41
  return new MPCameraPosition(
43
42
  object?.zoom,
44
43
  target,
45
- object?.bearing ?? 0,
46
- object?.tilt ?? 0,
44
+ object?.bearing ? object.bearing : 0,
45
+ object?.tilt ? object.tilt : 0,
47
46
  );
48
47
  }
49
48
  }
@@ -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}.
@@ -45,11 +45,11 @@ export default class MPFilterBehavior {
45
45
  */
46
46
  public static create(object?: MPFilterBehaviorParams): MPFilterBehavior {
47
47
  return new MPFilterBehavior(
48
- object?.allowFloorChange ?? false,
49
- object?.moveCamera ?? false,
50
- object?.animationDuration ?? 0,
51
- object?.showInfoWindow ?? false,
52
- object?.zoomToFit ?? true
48
+ object?.allowFloorChange ? object.allowFloorChange : false,
49
+ object?.moveCamera ? object.moveCamera : false,
50
+ object?.animationDuration ? object.animationDuration : 0,
51
+ object?.showInfoWindow ? object.showInfoWindow : false,
52
+ object?.zoomToFit ? object?.zoomToFit : true
53
53
  );
54
54
  };
55
55
  }
@@ -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
 
@@ -41,7 +41,7 @@ export default class MPLocation extends MPEntity {
41
41
  * @type {MPPoint}
42
42
  */
43
43
  public override get position(): MPPoint {
44
- return this.properties?.anchor ?? new MPPoint(0, 0);
44
+ return this.properties?.anchor ? this.properties.anchor : new MPPoint(0, 0);
45
45
  }
46
46
 
47
47
  /**
@@ -280,7 +280,7 @@ export default class MPLocation extends MPEntity {
280
280
  * @returns {boolean}
281
281
  */
282
282
  public isBookable(): boolean {
283
- return this.properties?.bookable ?? false;
283
+ return this.properties?.bookable ? this.properties.bookable : false;
284
284
  }
285
285
 
286
286
  /**
@@ -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
  /**
@@ -95,7 +95,10 @@ export default class MPMultiPolygon extends MPGeometry {
95
95
  * @type {MPBounds}
96
96
  */
97
97
  public get bounds(): MPBounds {
98
- return this._bounds ??= MPBounds.fromBBox(this._bbox);
98
+ if (this._bounds == undefined) {
99
+ this._bounds = MPBounds.fromBBox(this._bbox);
100
+ }
101
+ return this._bounds;
99
102
  }
100
103
 
101
104
  /**
@@ -106,7 +109,10 @@ export default class MPMultiPolygon extends MPGeometry {
106
109
  * @returns {Promise<number>}
107
110
  */
108
111
  public async getArea(): Promise<number> {
109
- return Promise.resolve(this._area ??= await MPUtils.geometryArea(this));
112
+ if (this._area == undefined) {
113
+ this._area = await MPUtils.geometryArea(this);
114
+ }
115
+ return Promise.resolve(this._area);
110
116
  }
111
117
 
112
118
 
@@ -174,8 +180,9 @@ export default class MPMultiPolygon extends MPGeometry {
174
180
  */
175
181
  public toJSON(): MPMultiPolygonParams {
176
182
  return {
177
- "coordinates": this._coordinates,
178
- "bbox": this._bbox,
183
+ type: this.type,
184
+ coordinates: this._coordinates,
185
+ bbox: this._bbox,
179
186
  }
180
187
  }
181
188
  }
@@ -190,6 +197,12 @@ export default class MPMultiPolygon extends MPGeometry {
190
197
  */
191
198
  export interface MPMultiPolygonParams {
192
199
 
200
+ /**
201
+ * the type of the geometry, leave this blank as it is just used to parse the geometry to JSON
202
+ *
203
+ * @type {string}
204
+ */
205
+ type?: string,
193
206
  /**
194
207
  * Geometry, as specified in the [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.7}.
195
208
  *
@@ -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
@@ -65,13 +63,12 @@ export default class MPPoint extends MPGeometry {
65
63
  * @param {MPPointParams} pointParams
66
64
  * @returns {MPPoint}
67
65
  */
68
- public static create(pointParams: MPPointParams): MPPoint | undefined {
66
+ public static create(pointParams: MPPointParams): MPPoint {
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]);
73
- }else {
74
- return null;
70
+ const pp = pointParams as unknown as number[]
71
+ return new MPPoint(pp[1], pp[0], pp[2]);
75
72
  }
76
73
  }
77
74
 
@@ -141,7 +138,8 @@ export default class MPPoint extends MPGeometry {
141
138
  */
142
139
  public toJSON(): MPPointParams {
143
140
  return {
144
- coordinates: [this.longitude, this.latitude, this.floorIndex ?? 0],
141
+ type: this.type,
142
+ coordinates: [this.longitude, this.latitude, this.floorIndex ? this.floorIndex : 0],
145
143
  };
146
144
  }
147
145
  }
@@ -155,11 +153,17 @@ export default class MPPoint extends MPGeometry {
155
153
  */
156
154
  export interface MPPointParams {
157
155
  /**
158
- * Coordinate holder for point, on the form:.
156
+ * the type of the geometry, leave this blank as it is just used to parse the geometry to JSON
159
157
  *
158
+ * @type {string}
159
+ */
160
+ type?: string,
161
+ /**
162
+ * Coordinate holder for point, on the form:.
163
+ *
160
164
  * [LNG, LAT, FLOOR]
161
165
  *
162
166
  * @type {number[]}
163
167
  */
164
168
  coordinates: number[],
165
- }
169
+ }
@@ -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
  /**
@@ -95,7 +95,10 @@ export default class MPPolygon extends MPGeometry {
95
95
  * @type {MPBounds}
96
96
  */
97
97
  public get bounds(): MPBounds {
98
- return this._bounds ??= MPBounds.fromBBox(this._bbox);
98
+ if (this._bounds == undefined) {
99
+ this._bounds = MPBounds.fromBBox(this._bbox)
100
+ }
101
+ return this._bounds;
99
102
  }
100
103
 
101
104
  /**
@@ -106,7 +109,10 @@ export default class MPPolygon extends MPGeometry {
106
109
  * @returns {Promise<number>}
107
110
  */
108
111
  public async getArea(): Promise<number> {
109
- return Promise.resolve(this._area ??= await MPUtils.geometryArea(this));
112
+ if (this._area == undefined) {
113
+ this._area = await MPUtils.geometryArea(this);
114
+ }
115
+ return Promise.resolve(this._area);
110
116
  }
111
117
 
112
118
  /**
@@ -175,8 +181,9 @@ export default class MPPolygon extends MPGeometry {
175
181
  */
176
182
  public toJSON(): MPPolygonParams {
177
183
  return {
178
- "coordinates": this._coordinates,
179
- "bbox": this._bbox,
184
+ type: this.type,
185
+ coordinates: this._coordinates,
186
+ bbox: this._bbox,
180
187
  }
181
188
  }
182
189
  }
@@ -191,6 +198,12 @@ export default class MPPolygon extends MPGeometry {
191
198
  */
192
199
  export interface MPPolygonParams {
193
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,
194
207
  /**
195
208
  * Geometry, as specified in the [GeoJSON format]{@link https://stevage.github.io/geojson-spec/#section-3.1.6}.
196
209
  *
@@ -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
  /**
@@ -68,7 +68,7 @@ export default class MPPropertyData extends MPEntityInfo {
68
68
  public static create(object: MPPropertyDataParams): MPPropertyData {
69
69
  var floor;
70
70
  if (Platform.OS === 'ios') {
71
- floor = object.floor as number;
71
+ floor = object?.floor as number;
72
72
  }else {
73
73
  floor = object?.floor ? parseInt(object?.floor as string) : undefined;
74
74
  }
@@ -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}.