@mapsindoors/react-native-maps-indoors-mapbox 1.0.2 → 1.0.4

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 (150) hide show
  1. package/LICENSE +10 -10
  2. package/README.md +187 -187
  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/executionHistory/executionHistory.bin +0 -0
  8. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  9. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  10. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/file-system.probe +0 -0
  16. package/android/.idea/compiler.xml +6 -0
  17. package/android/.idea/gradle.xml +19 -0
  18. package/android/.idea/jarRepositories.xml +60 -0
  19. package/android/.idea/misc.xml +10 -0
  20. package/android/.idea/vcs.xml +7 -0
  21. package/android/README.md +14 -14
  22. package/android/build.gradle +166 -166
  23. package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  24. package/android/gradle.properties +16 -16
  25. package/android/gradlew +234 -234
  26. package/android/local.properties +8 -0
  27. package/android/src/main/AndroidManifest.xml +6 -6
  28. package/android/src/main/java/com/reactlibrary/MapboxMapView.java +116 -116
  29. package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +53 -53
  30. package/android/src/main/java/com/reactlibrary/MapsIndoorsViewManager.java +119 -119
  31. package/android/src/main/java/com/reactlibrary/core/DirectionsRendererModule.java +218 -208
  32. package/android/src/main/java/com/reactlibrary/core/DirectionsServiceModule.java +130 -130
  33. package/android/src/main/java/com/reactlibrary/core/MPDisplayRuleModule.java +816 -816
  34. package/android/src/main/java/com/reactlibrary/core/MapControlModule.java +638 -628
  35. package/android/src/main/java/com/reactlibrary/core/MapsIndoorsModule.java +327 -327
  36. package/android/src/main/java/com/reactlibrary/core/RCMapView.java +16 -16
  37. package/android/src/main/java/com/reactlibrary/core/README.md +92 -92
  38. package/android/src/main/java/com/reactlibrary/core/UtilsModule.java +166 -166
  39. package/android/src/main/java/com/reactlibrary/core/models/Bounds.java +19 -19
  40. package/android/src/main/java/com/reactlibrary/core/models/Filter.java +77 -77
  41. package/android/src/main/java/com/reactlibrary/core/models/Location.java +17 -17
  42. package/android/src/main/java/com/reactlibrary/core/models/MPCameraPosition.java +34 -34
  43. package/android/src/main/java/com/reactlibrary/core/models/MPCameraUpdate.java +68 -68
  44. package/android/src/main/java/com/reactlibrary/core/models/MPError.java +38 -38
  45. package/android/src/main/java/com/reactlibrary/core/models/PositionProvider.java +46 -46
  46. package/android/src/main/java/com/reactlibrary/core/models/PositionResult.java +117 -117
  47. package/android/src/main/java/com/reactlibrary/core/models/Query.java +30 -30
  48. package/android/src/main/res/values/google_maps_api_key.xml +3 -3
  49. package/android/src/main/res/values/mapbox_api_key.xml +5 -5
  50. package/index.ts +183 -183
  51. package/ios/MapsIndoors.xcodeproj/project.pbxproj +318 -318
  52. package/ios/MapsIndoors.xcworkspace/contents.xcworkspacedata +7 -7
  53. package/ios/MapsIndoors.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  54. package/ios/MapsIndoorsViewManager.swift +111 -111
  55. package/ios/MapsIndoorsViewManagerBridge.m +9 -9
  56. package/ios/core/CameraPosition.swift +15 -15
  57. package/ios/core/CameraUpdate.swift +19 -19
  58. package/ios/core/CameraUpdateError.swift +11 -11
  59. package/ios/core/DirectionsRendererBridge.m +61 -57
  60. package/ios/core/DirectionsRendererModule.swift +251 -237
  61. package/ios/core/DirectionsServiceBridge.m +46 -46
  62. package/ios/core/DirectionsServiceModule.swift +149 -149
  63. package/ios/core/MPDisplayRuleBridge.m +410 -410
  64. package/ios/core/MPDisplayRuleModule.swift +845 -845
  65. package/ios/core/MapControlBridge.m +184 -178
  66. package/ios/core/MapControlModule.swift +566 -515
  67. package/ios/core/MapsIndoorsBridge.m +116 -116
  68. package/ios/core/MapsIndoorsData.swift +218 -218
  69. package/ios/core/MapsIndoorsModule.swift +296 -296
  70. package/ios/core/RCMapView.swift +14 -14
  71. package/ios/core/README.md +92 -92
  72. package/ios/core/ReactPositionProvider.swift +25 -25
  73. package/ios/core/UtilsBridge.m +63 -63
  74. package/ios/core/UtilsModule.swift +146 -146
  75. package/ios/core/helpers.swift +57 -57
  76. package/ios/react-native-maps-indoors-Bridging-Header.h +6 -6
  77. package/package.json +53 -53
  78. package/react-native-maps-indoors-mapbox.podspec +30 -30
  79. package/src/core/EventNames.ts +20 -20
  80. package/src/core/MPBounds.ts +154 -154
  81. package/src/core/MPBuilding.ts +333 -333
  82. package/src/core/MPBuildingCollection.ts +56 -56
  83. package/src/core/MPBuildingInfo.ts +62 -62
  84. package/src/core/MPCameraEvent.ts +16 -16
  85. package/src/core/MPCameraEventListener.ts +16 -16
  86. package/src/core/MPCameraPosition.ts +82 -82
  87. package/src/core/MPCameraUpdate.ts +174 -174
  88. package/src/core/MPCameraViewFitMode.ts +20 -20
  89. package/src/core/MPCategory.ts +75 -75
  90. package/src/core/MPCategoryCollection.ts +61 -61
  91. package/src/core/MPCollection.ts +58 -58
  92. package/src/core/MPCollisionHandling.ts +11 -11
  93. package/src/core/MPDataField.ts +68 -68
  94. package/src/core/MPDirectionsRenderer.ts +205 -193
  95. package/src/core/MPDirectionsService.ts +118 -118
  96. package/src/core/MPDisplayRule.ts +1027 -1027
  97. package/src/core/MPEntity.ts +59 -59
  98. package/src/core/MPEntityInfo.ts +27 -27
  99. package/src/core/MPError.ts +122 -122
  100. package/src/core/MPFilter.ts +167 -167
  101. package/src/core/MPFilterBehavior.ts +94 -94
  102. package/src/core/MPFloor.ts +169 -169
  103. package/src/core/MPFloorSelectorInterface.ts +62 -62
  104. package/src/core/MPGeometry.ts +90 -90
  105. package/src/core/MPHighway.ts +14 -14
  106. package/src/core/MPIconSize.ts +38 -38
  107. package/src/core/MPLocation.ts +385 -385
  108. package/src/core/MPLocationPropertyNames.ts +29 -29
  109. package/src/core/MPLocationType.ts +15 -15
  110. package/src/core/MPMapConfig.ts +210 -210
  111. package/src/core/MPMapStyle.ts +56 -56
  112. package/src/core/MPMultiPolygon.ts +217 -217
  113. package/src/core/MPPoint.ts +169 -169
  114. package/src/core/MPPolygon.ts +218 -218
  115. package/src/core/MPPositionProviderInterface.ts +44 -44
  116. package/src/core/MPPositionResultInterface.ts +41 -41
  117. package/src/core/MPPropertyData.ts +214 -214
  118. package/src/core/MPQuery.ts +68 -68
  119. package/src/core/MPRoute.ts +94 -94
  120. package/src/core/MPRouteCoordinate.ts +94 -94
  121. package/src/core/MPRouteLeg.ts +127 -127
  122. package/src/core/MPRouteProperty.ts +82 -82
  123. package/src/core/MPRouteStep.ts +176 -176
  124. package/src/core/MPSelectionBehavior.ts +92 -92
  125. package/src/core/MPSettings3D.ts +106 -106
  126. package/src/core/MPSize.ts +20 -20
  127. package/src/core/MPSolution.ts +179 -179
  128. package/src/core/MPSolutionConfig.ts +126 -126
  129. package/src/core/MPSolutionDisplayRule.ts +13 -13
  130. package/src/core/MPUserRole.ts +59 -59
  131. package/src/core/MPUserRoleCollection.ts +36 -36
  132. package/src/core/MPUtils.ts +156 -156
  133. package/src/core/MPVenue.ts +293 -293
  134. package/src/core/MPVenueCollection.ts +57 -57
  135. package/src/core/MPVenueInfo.ts +61 -61
  136. package/src/core/MapControl.ts +882 -864
  137. package/src/core/MapView.tsx +33 -33
  138. package/src/core/MapsIndoors.ts +530 -530
  139. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +16 -16
  140. package/src/core/OnFloorSelectionChangedListener.ts +16 -16
  141. package/src/core/OnFloorUpdateListener.ts +15 -15
  142. package/src/core/OnLegSelectedListener.ts +16 -16
  143. package/src/core/OnLiveLocationUpdateListener.ts +16 -16
  144. package/src/core/OnLocationSelectedListener.ts +16 -16
  145. package/src/core/OnMapClickListener.ts +19 -19
  146. package/src/core/OnMarkerClickListener.ts +16 -16
  147. package/src/core/OnMarkerInfoWindowClickListener.ts +16 -16
  148. package/src/core/OnPositionUpdateListener.ts +16 -16
  149. package/src/core/OnVenueFoundAtCameraTargetListener.ts +16 -16
  150. package/src/core/README.md +92 -92
package/LICENSE CHANGED
@@ -1,11 +1,11 @@
1
- Copyright 2023 Mapspeople
2
-
3
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
-
5
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
-
7
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
-
9
- 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
-
1
+ Copyright 2023 Mapspeople
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
11
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,187 +1,187 @@
1
- # react-native-maps-indoors-mapbox
2
-
3
- ## Documentation
4
-
5
- Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/1.0.2/index.html) to get an overview of what the MapsIndoors SDK offers.
6
-
7
- ## Getting started
8
-
9
- `$ npm install @mapsindoors/react-native-maps-indoors-mapbox`
10
-
11
- ### iOS
12
-
13
- The MapsIndoors SDK requires iOS 13, so make sure that your podfile is configured for iOS 13.
14
- Add !use_frameworks inside your app target as well.
15
-
16
- ```pod
17
- platform :ios, '13.0
18
-
19
- target 'MyApp' do
20
- use_frameworks!
21
- ...
22
- ```
23
-
24
- #### Providing API key
25
-
26
- 1. Navigate to your application settings and add your Mapbox public access token to info with the key `MBXAccessToken`
27
- 2. Setup your secret access token for downloading the sdk. Read how to do this here: [Configure credentials](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials)
28
-
29
- ### Android
30
-
31
- #### Android Gooogle Maps Setup
32
-
33
- ​
34
- To get the underlying Google Map to function, you need to perform the following steps:
35
- ​
36
-
37
- 1. Navigate to `android/app/src/main/res/value`.
38
- 2. Create a file in this folder called `mapbox_api_key.xml`.
39
- 3. Copy and paste the below code snippet and replace `YOUR_KEY_HERE` with your Mapbox api key.
40
- ​
41
-
42
- ```xml
43
- <?xml version="1.0" encoding="utf-8"?>
44
- <resources>
45
- <string name="mapbox_api_key" translatable="false">YOUR_KEY_HERE</string>
46
- </resources>
47
- ```
48
-
49
- #### MapsIndoors Gradle Setup
50
-
51
- ​
52
- The plugin Gradle project has trouble resolving the MapsIndoors dependency, so to ensure that it is resolved correctly, do the following:
53
-
54
- 1. Navigate to the app `gradle.properties` and add the value MAPBOX_DOWNLOADS_TOKEN with your Mapbox download access token.
55
- 2. Navigate to the app's project level `build.gradle`.
56
- 3. add `maven { url 'https://maven.mapsindoors.com/' }` to `allprojects`/`repositories` as well as the Mapbox maven
57
- ​
58
-
59
- ```groovy
60
- allprojects {
61
- repositories {
62
- google()
63
- mavenCentral()
64
- maven { url 'https://maven.mapsindoors.com/' }
65
- maven {
66
- url 'https://api.mapbox.com/downloads/v2/releases/maven'
67
- authentication {
68
- basic(BasicAuthentication)
69
- }
70
- credentials {
71
- // Do not change the username below.
72
- // This should always be `mapbox` (not your username).
73
- username = "mapbox"
74
- // Use the secret token you stored in gradle.properties as the password
75
- password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
76
- }
77
- }
78
- }
79
- }
80
- ```
81
-
82
- ## Usage
83
-
84
- ### Showing your map
85
-
86
- This snippet shows you how to set up MapsIndoors in a React Native application.
87
-
88
- ```javascript
89
- import MapsIndoors, { MapControl, MapView } from 'react-native-maps-indoors';
90
- ...
91
- //Function to initialize mapsindoors and mapcontrol. To load a solution and show data onto the map.
92
- const loadMapsIndoors = () => {
93
- //Load solution data with your api key
94
- MapsIndoors.load('API_KEY').then(async () => {
95
- //Create the MapControl. Which will be using the MapView of the component.
96
- const mc = await MapControl.create(new MPMapConfig({useDefaultMapsIndoorsStyle: true}), NativeEventEmitter);
97
- //Get a venue and move the camera to it.
98
- let venue: MPVenue = (await MapsIndoors.getVenues()).getAll()[0];
99
- mapControl.goTo(venue);
100
- }
101
- }
102
-
103
- ...
104
- render() {
105
- return (
106
- <MapView
107
- style={{
108
- width: Dimensions.get('window').width,
109
- height: Dimensions.get('window').height,
110
- }}
111
- />
112
- );
113
- }
114
- ...
115
- ```
116
-
117
- ### Showing a route
118
-
119
- ```javascript
120
- const showRoute = async () => {
121
- let point = new MPPoint(57.0580431, 9.9505475);
122
- let point2 = new MPPoint(57.0581638, 9.9507732, 10);
123
- var directionsService = await MPDirectionsService.create();
124
-
125
- //Optional query parameters for the route.
126
- directionsService.setIsDeparture(true);
127
- directionsService.setTime(Date.now());
128
- directionsService.setTravelMode('bicycling');
129
-
130
- var route = await directionsService.getRoute(point, point2);
131
- directionsRenderer = new MPDirectionsRenderer(NativeEventEmitter);
132
- directionsRenderer.setRoute(route);
133
- };
134
- ```
135
-
136
- ### Searching locations
137
-
138
- This code snippet shows a function called `searchForParking` that takes a single argument of type `MPPoint`. The function uses `MapsIndoors` to search for locations matching the query string `"parking"` near the point specified, and uses the filter to only get the first 10 matches.
139
- ​
140
- It mathces in the locations' descriptions, names, and external IDs to the query string. Once the search is complete, it is possible to update/get information from the locations (not specified in the code snippet).
141
-
142
- ```javascript
143
- const searchForParking = async (point: MPPoint) => {
144
- let query = MPQuery.create({query: "parking",
145
- near: point,
146
- queryProperties: [MPLocationPropertyNames.description, MPLocationPropertyNames.name, MPLocationPropertyNames.externalId]});
147
- let filter = MPFilter.create({take: 10});
148
- let parkingLotsNearPoint = await MapsIndoors.getLocationsAsync(query, filter);
149
- }
150
- ```
151
-
152
- ### Changing the look with DisplayRules
153
-
154
- ​
155
- This code snippet shows three ways to manipulate display rules in the MapsIndoors SDK.
156
- ​
157
- The `hideLocationsByDefault` method hides all markers that are not explicitly visible by setting the main display rule to not visible.
158
- ​
159
- The `showLocationsByDefault` method ensures all markers are shown by setting the main display rule to visible.
160
- ​
161
- The `changeTypePolygonColor(String type, String color)` method changes the fill color for all polygons belonging to a specific type. It gets the display rule for the specified type using `getDisplayRuleByName`, and sets the fill color using `setPolygonFillColor`.
162
- ​
163
- These methods can all be used to customize the display of markers and polygons on the map.
164
- ​
165
-
166
- ```javascript
167
- // This method changes the main display rule to hide all markers,
168
- // This will cause all locations/types that are not explicitly visible to be hidden.
169
- const hideLocationsByDefault = async () => {
170
- let mainDisplayRule = await MapsIndoors.getMainDisplayRule();
171
- mainDisplayRule?.setVisible(false);
172
- }
173
- ​
174
- // This method changes the main display rule to show all markers,
175
- // This will cause all locations/types that are not explicitly visible to be shown.
176
- const showLocationsByDefault = async () => {
177
- let mainDisplayRule = await MapsIndoors.getMainDisplayRule();
178
- mainDisplayRule?.setVisible(true);
179
- }
180
- ​
181
- // This method changes the fill color for all polygons belonging to a specific [type]
182
- // the color MUST be a valid hex color string.
183
- const changeTypePolygonColor = async (type: string, color: string) => {
184
- let typeDisplayRule = await MapsIndoors.getDisplayRuleByName(type);
185
- typeDisplayRule?.setPolygonFillColor(color);
186
- }
187
- ```
1
+ # react-native-maps-indoors-mapbox
2
+
3
+ ## Documentation
4
+
5
+ Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/1.0.4/index.html) to get an overview of what the MapsIndoors SDK offers.
6
+
7
+ ## Getting started
8
+
9
+ `$ npm install @mapsindoors/react-native-maps-indoors-mapbox`
10
+
11
+ ### iOS
12
+
13
+ The MapsIndoors SDK requires iOS 13, so make sure that your podfile is configured for iOS 13.
14
+ Add !use_frameworks inside your app target as well.
15
+
16
+ ```pod
17
+ platform :ios, '13.0
18
+
19
+ target 'MyApp' do
20
+ use_frameworks!
21
+ ...
22
+ ```
23
+
24
+ #### Providing API key
25
+
26
+ 1. Navigate to your application settings and add your Mapbox public access token to info with the key `MBXAccessToken`
27
+ 2. Setup your secret access token for downloading the sdk. Read how to do this here: [Configure credentials](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials)
28
+
29
+ ### Android
30
+
31
+ #### Android Gooogle Maps Setup
32
+
33
+ ​
34
+ To get the underlying Google Map to function, you need to perform the following steps:
35
+ ​
36
+
37
+ 1. Navigate to `android/app/src/main/res/value`.
38
+ 2. Create a file in this folder called `mapbox_api_key.xml`.
39
+ 3. Copy and paste the below code snippet and replace `YOUR_KEY_HERE` with your Mapbox api key.
40
+ ​
41
+
42
+ ```xml
43
+ <?xml version="1.0" encoding="utf-8"?>
44
+ <resources>
45
+ <string name="mapbox_api_key" translatable="false">YOUR_KEY_HERE</string>
46
+ </resources>
47
+ ```
48
+
49
+ #### MapsIndoors Gradle Setup
50
+
51
+ ​
52
+ The plugin Gradle project has trouble resolving the MapsIndoors dependency, so to ensure that it is resolved correctly, do the following:
53
+
54
+ 1. Navigate to the app `gradle.properties` and add the value MAPBOX_DOWNLOADS_TOKEN with your Mapbox download access token.
55
+ 2. Navigate to the app's project level `build.gradle`.
56
+ 3. add `maven { url 'https://maven.mapsindoors.com/' }` to `allprojects`/`repositories` as well as the Mapbox maven
57
+ ​
58
+
59
+ ```groovy
60
+ allprojects {
61
+ repositories {
62
+ google()
63
+ mavenCentral()
64
+ maven { url 'https://maven.mapsindoors.com/' }
65
+ maven {
66
+ url 'https://api.mapbox.com/downloads/v2/releases/maven'
67
+ authentication {
68
+ basic(BasicAuthentication)
69
+ }
70
+ credentials {
71
+ // Do not change the username below.
72
+ // This should always be `mapbox` (not your username).
73
+ username = "mapbox"
74
+ // Use the secret token you stored in gradle.properties as the password
75
+ password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
76
+ }
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Usage
83
+
84
+ ### Showing your map
85
+
86
+ This snippet shows you how to set up MapsIndoors in a React Native application.
87
+
88
+ ```javascript
89
+ import MapsIndoors, { MapControl, MapView } from 'react-native-maps-indoors';
90
+ ...
91
+ //Function to initialize mapsindoors and mapcontrol. To load a solution and show data onto the map.
92
+ const loadMapsIndoors = () => {
93
+ //Load solution data with your api key
94
+ MapsIndoors.load('API_KEY').then(async () => {
95
+ //Create the MapControl. Which will be using the MapView of the component.
96
+ const mc = await MapControl.create(new MPMapConfig({useDefaultMapsIndoorsStyle: true}), NativeEventEmitter);
97
+ //Get a venue and move the camera to it.
98
+ let venue: MPVenue = (await MapsIndoors.getVenues()).getAll()[0];
99
+ mapControl.goTo(venue);
100
+ }
101
+ }
102
+
103
+ ...
104
+ render() {
105
+ return (
106
+ <MapView
107
+ style={{
108
+ width: Dimensions.get('window').width,
109
+ height: Dimensions.get('window').height,
110
+ }}
111
+ />
112
+ );
113
+ }
114
+ ...
115
+ ```
116
+
117
+ ### Showing a route
118
+
119
+ ```javascript
120
+ const showRoute = async () => {
121
+ let point = new MPPoint(57.0580431, 9.9505475);
122
+ let point2 = new MPPoint(57.0581638, 9.9507732, 10);
123
+ var directionsService = await MPDirectionsService.create();
124
+
125
+ //Optional query parameters for the route.
126
+ directionsService.setIsDeparture(true);
127
+ directionsService.setTime(Date.now());
128
+ directionsService.setTravelMode('bicycling');
129
+
130
+ var route = await directionsService.getRoute(point, point2);
131
+ directionsRenderer = new MPDirectionsRenderer(NativeEventEmitter);
132
+ directionsRenderer.setRoute(route);
133
+ };
134
+ ```
135
+
136
+ ### Searching locations
137
+
138
+ This code snippet shows a function called `searchForParking` that takes a single argument of type `MPPoint`. The function uses `MapsIndoors` to search for locations matching the query string `"parking"` near the point specified, and uses the filter to only get the first 10 matches.
139
+ ​
140
+ It mathces in the locations' descriptions, names, and external IDs to the query string. Once the search is complete, it is possible to update/get information from the locations (not specified in the code snippet).
141
+
142
+ ```javascript
143
+ const searchForParking = async (point: MPPoint) => {
144
+ let query = MPQuery.create({query: "parking",
145
+ near: point,
146
+ queryProperties: [MPLocationPropertyNames.description, MPLocationPropertyNames.name, MPLocationPropertyNames.externalId]});
147
+ let filter = MPFilter.create({take: 10});
148
+ let parkingLotsNearPoint = await MapsIndoors.getLocationsAsync(query, filter);
149
+ }
150
+ ```
151
+
152
+ ### Changing the look with DisplayRules
153
+
154
+ ​
155
+ This code snippet shows three ways to manipulate display rules in the MapsIndoors SDK.
156
+ ​
157
+ The `hideLocationsByDefault` method hides all markers that are not explicitly visible by setting the main display rule to not visible.
158
+ ​
159
+ The `showLocationsByDefault` method ensures all markers are shown by setting the main display rule to visible.
160
+ ​
161
+ The `changeTypePolygonColor(String type, String color)` method changes the fill color for all polygons belonging to a specific type. It gets the display rule for the specified type using `getDisplayRuleByName`, and sets the fill color using `setPolygonFillColor`.
162
+ ​
163
+ These methods can all be used to customize the display of markers and polygons on the map.
164
+ ​
165
+
166
+ ```javascript
167
+ // This method changes the main display rule to hide all markers,
168
+ // This will cause all locations/types that are not explicitly visible to be hidden.
169
+ const hideLocationsByDefault = async () => {
170
+ let mainDisplayRule = await MapsIndoors.getMainDisplayRule();
171
+ mainDisplayRule?.setVisible(false);
172
+ }
173
+ ​
174
+ // This method changes the main display rule to show all markers,
175
+ // This will cause all locations/types that are not explicitly visible to be shown.
176
+ const showLocationsByDefault = async () => {
177
+ let mainDisplayRule = await MapsIndoors.getMainDisplayRule();
178
+ mainDisplayRule?.setVisible(true);
179
+ }
180
+ ​
181
+ // This method changes the fill color for all polygons belonging to a specific [type]
182
+ // the color MUST be a valid hex color string.
183
+ const changeTypePolygonColor = async (type: string, color: string) => {
184
+ let typeDisplayRule = await MapsIndoors.getDisplayRuleByName(type);
185
+ typeDisplayRule?.setPolygonFillColor(color);
186
+ }
187
+ ```
@@ -1,2 +1,2 @@
1
- #Mon Jun 26 10:23:28 CEST 2023
2
- gradle.version=7.4
1
+ #Thu Feb 02 14:40:19 CET 2023
2
+ gradle.version=7.4
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CompilerConfiguration">
4
+ <bytecodeTargetLevel target="11" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GradleMigrationSettings" migrationVersion="1" />
4
+ <component name="GradleSettings">
5
+ <option name="linkedExternalProjectsSettings">
6
+ <GradleProjectSettings>
7
+ <option name="testRunner" value="GRADLE" />
8
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+ <option name="gradleJvm" value="11" />
11
+ <option name="modules">
12
+ <set>
13
+ <option value="$PROJECT_DIR$" />
14
+ </set>
15
+ </option>
16
+ </GradleProjectSettings>
17
+ </option>
18
+ </component>
19
+ </project>
@@ -0,0 +1,60 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="RemoteRepositoriesConfiguration">
4
+ <remote-repository>
5
+ <option name="id" value="central" />
6
+ <option name="name" value="Maven Central repository" />
7
+ <option name="url" value="https://repo1.maven.org/maven2" />
8
+ </remote-repository>
9
+ <remote-repository>
10
+ <option name="id" value="jboss.community" />
11
+ <option name="name" value="JBoss Community repository" />
12
+ <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
13
+ </remote-repository>
14
+ <remote-repository>
15
+ <option name="id" value="MavenLocal" />
16
+ <option name="name" value="MavenLocal" />
17
+ <option name="url" value="file:$USER_HOME$/.m2/repository/" />
18
+ </remote-repository>
19
+ <remote-repository>
20
+ <option name="id" value="MavenRepo" />
21
+ <option name="name" value="MavenRepo" />
22
+ <option name="url" value="https://repo.maven.apache.org/maven2/" />
23
+ </remote-repository>
24
+ <remote-repository>
25
+ <option name="id" value="maven2" />
26
+ <option name="name" value="maven2" />
27
+ <option name="url" value="file:$PROJECT_DIR$/../node_modules/jsc-android/dist/" />
28
+ </remote-repository>
29
+ <remote-repository>
30
+ <option name="id" value="maven" />
31
+ <option name="name" value="maven" />
32
+ <option name="url" value="file:$PROJECT_DIR$/../node_modules/react-native/android/" />
33
+ </remote-repository>
34
+ <remote-repository>
35
+ <option name="id" value="Google" />
36
+ <option name="name" value="Google" />
37
+ <option name="url" value="https://dl.google.com/dl/android/maven2/" />
38
+ </remote-repository>
39
+ <remote-repository>
40
+ <option name="id" value="maven" />
41
+ <option name="name" value="maven" />
42
+ <option name="url" value="https://maven.mapsindoors.com/" />
43
+ </remote-repository>
44
+ <remote-repository>
45
+ <option name="id" value="maven3" />
46
+ <option name="name" value="maven3" />
47
+ <option name="url" value="file:$USER_HOME$/React%20Native%20with%20submodules/react-native-mapsindoors-mapbox/node_modules/jsc-android/dist/" />
48
+ </remote-repository>
49
+ <remote-repository>
50
+ <option name="id" value="maven4" />
51
+ <option name="name" value="maven4" />
52
+ <option name="url" value="https://api.mapbox.com/downloads/v2/releases/maven" />
53
+ </remote-repository>
54
+ <remote-repository>
55
+ <option name="id" value="maven2" />
56
+ <option name="name" value="maven2" />
57
+ <option name="url" value="file:$USER_HOME$/React%20Native%20with%20submodules/react-native-mapsindoors-mapbox/node_modules/react-native/android/" />
58
+ </remote-repository>
59
+ </component>
60
+ </project>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
5
+ <output url="file://$PROJECT_DIR$/build/classes" />
6
+ </component>
7
+ <component name="ProjectType">
8
+ <option name="id" value="Android" />
9
+ </component>
10
+ </project>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$USER_HOME$" vcs="Git" />
5
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
6
+ </component>
7
+ </project>
package/android/README.md CHANGED
@@ -1,14 +1,14 @@
1
- README
2
- ======
3
-
4
- If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
5
-
6
- 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
7
- 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
8
- ```
9
- ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
10
- sdk.dir=/Users/{username}/Library/Android/sdk
11
- ```
12
- 3. Delete the `maven` folder
13
- 4. Run `./gradlew installArchives`
14
- 5. Verify that latest set of generated files is in the maven folder with the correct version number
1
+ README
2
+ ======
3
+
4
+ If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
5
+
6
+ 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
7
+ 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
8
+ ```
9
+ ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
10
+ sdk.dir=/Users/{username}/Library/Android/sdk
11
+ ```
12
+ 3. Delete the `maven` folder
13
+ 4. Run `./gradlew installArchives`
14
+ 5. Verify that latest set of generated files is in the maven folder with the correct version number