@mapsindoors/react-native-maps-indoors-mapbox 1.0.1 → 1.0.3
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.
- package/LICENSE +10 -10
- package/README.md +187 -183
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/README.md +14 -14
- package/android/build.gradle +166 -166
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradle.properties +16 -16
- package/android/gradlew +234 -234
- package/android/src/main/AndroidManifest.xml +6 -6
- package/android/src/main/java/com/reactlibrary/MapboxMapView.java +116 -116
- package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +53 -53
- package/android/src/main/java/com/reactlibrary/MapsIndoorsViewManager.java +119 -119
- package/android/src/main/java/com/reactlibrary/core/DirectionsRendererModule.java +218 -208
- package/android/src/main/java/com/reactlibrary/core/DirectionsServiceModule.java +130 -130
- package/android/src/main/java/com/reactlibrary/core/MPDisplayRuleModule.java +816 -816
- package/android/src/main/java/com/reactlibrary/core/MapControlModule.java +636 -628
- package/android/src/main/java/com/reactlibrary/core/MapsIndoorsModule.java +327 -327
- package/android/src/main/java/com/reactlibrary/core/RCMapView.java +16 -16
- package/android/src/main/java/com/reactlibrary/core/README.md +92 -92
- package/android/src/main/java/com/reactlibrary/core/UtilsModule.java +166 -166
- package/android/src/main/java/com/reactlibrary/core/models/Bounds.java +19 -19
- package/android/src/main/java/com/reactlibrary/core/models/Filter.java +77 -77
- package/android/src/main/java/com/reactlibrary/core/models/Location.java +17 -17
- package/android/src/main/java/com/reactlibrary/core/models/MPCameraPosition.java +34 -34
- package/android/src/main/java/com/reactlibrary/core/models/MPCameraUpdate.java +68 -68
- package/android/src/main/java/com/reactlibrary/core/models/MPError.java +38 -38
- package/android/src/main/java/com/reactlibrary/core/models/PositionProvider.java +46 -46
- package/android/src/main/java/com/reactlibrary/core/models/PositionResult.java +117 -117
- package/android/src/main/java/com/reactlibrary/core/models/Query.java +30 -30
- package/android/src/main/res/values/google_maps_api_key.xml +3 -3
- package/android/src/main/res/values/mapbox_api_key.xml +5 -5
- package/index.ts +183 -183
- package/ios/MapsIndoors.xcodeproj/project.pbxproj +318 -318
- package/ios/MapsIndoors.xcworkspace/contents.xcworkspacedata +7 -7
- package/ios/MapsIndoors.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/ios/MapsIndoorsViewManager.swift +111 -111
- package/ios/MapsIndoorsViewManagerBridge.m +9 -9
- package/ios/core/CameraPosition.swift +15 -15
- package/ios/core/CameraUpdate.swift +19 -19
- package/ios/core/CameraUpdateError.swift +11 -11
- package/ios/core/DirectionsRendererBridge.m +61 -57
- package/ios/core/DirectionsRendererModule.swift +256 -237
- package/ios/core/DirectionsServiceBridge.m +46 -46
- package/ios/core/DirectionsServiceModule.swift +149 -149
- package/ios/core/MPDisplayRuleBridge.m +410 -410
- package/ios/core/MPDisplayRuleModule.swift +845 -845
- package/ios/core/MapControlBridge.m +184 -178
- package/ios/core/MapControlModule.swift +554 -515
- package/ios/core/MapsIndoorsBridge.m +116 -116
- package/ios/core/MapsIndoorsData.swift +218 -218
- package/ios/core/MapsIndoorsModule.swift +296 -296
- package/ios/core/RCMapView.swift +14 -14
- package/ios/core/README.md +92 -92
- package/ios/core/ReactPositionProvider.swift +25 -25
- package/ios/core/UtilsBridge.m +63 -63
- package/ios/core/UtilsModule.swift +146 -146
- package/ios/core/helpers.swift +57 -57
- package/ios/react-native-maps-indoors-Bridging-Header.h +6 -6
- package/package.json +53 -53
- package/react-native-maps-indoors-mapbox.podspec +30 -30
- package/src/core/EventNames.ts +20 -20
- package/src/core/MPBounds.ts +154 -154
- package/src/core/MPBuilding.ts +333 -333
- package/src/core/MPBuildingCollection.ts +56 -56
- package/src/core/MPBuildingInfo.ts +62 -62
- package/src/core/MPCameraEvent.ts +16 -16
- package/src/core/MPCameraEventListener.ts +16 -16
- package/src/core/MPCameraPosition.ts +82 -82
- package/src/core/MPCameraUpdate.ts +174 -174
- package/src/core/MPCameraViewFitMode.ts +20 -20
- package/src/core/MPCategory.ts +75 -75
- package/src/core/MPCategoryCollection.ts +61 -61
- package/src/core/MPCollection.ts +58 -58
- package/src/core/MPCollisionHandling.ts +11 -11
- package/src/core/MPDataField.ts +68 -68
- package/src/core/MPDirectionsRenderer.ts +205 -193
- package/src/core/MPDirectionsService.ts +118 -118
- package/src/core/MPDisplayRule.ts +1027 -1027
- package/src/core/MPEntity.ts +59 -59
- package/src/core/MPEntityInfo.ts +27 -27
- package/src/core/MPError.ts +122 -122
- package/src/core/MPFilter.ts +167 -167
- package/src/core/MPFilterBehavior.ts +94 -94
- package/src/core/MPFloor.ts +169 -169
- package/src/core/MPFloorSelectorInterface.ts +62 -62
- package/src/core/MPGeometry.ts +90 -90
- package/src/core/MPHighway.ts +14 -14
- package/src/core/MPIconSize.ts +38 -38
- package/src/core/MPLocation.ts +385 -385
- package/src/core/MPLocationPropertyNames.ts +29 -29
- package/src/core/MPLocationType.ts +15 -15
- package/src/core/MPMapConfig.ts +210 -210
- package/src/core/MPMapStyle.ts +56 -56
- package/src/core/MPMultiPolygon.ts +217 -217
- package/src/core/MPPoint.ts +169 -169
- package/src/core/MPPolygon.ts +218 -218
- package/src/core/MPPositionProviderInterface.ts +44 -44
- package/src/core/MPPositionResultInterface.ts +41 -41
- package/src/core/MPPropertyData.ts +214 -214
- package/src/core/MPQuery.ts +68 -68
- package/src/core/MPRoute.ts +94 -94
- package/src/core/MPRouteCoordinate.ts +94 -94
- package/src/core/MPRouteLeg.ts +127 -127
- package/src/core/MPRouteProperty.ts +82 -82
- package/src/core/MPRouteStep.ts +176 -175
- package/src/core/MPSelectionBehavior.ts +92 -92
- package/src/core/MPSettings3D.ts +106 -106
- package/src/core/MPSize.ts +20 -20
- package/src/core/MPSolution.ts +179 -179
- package/src/core/MPSolutionConfig.ts +126 -126
- package/src/core/MPSolutionDisplayRule.ts +13 -13
- package/src/core/MPUserRole.ts +59 -59
- package/src/core/MPUserRoleCollection.ts +36 -36
- package/src/core/MPUtils.ts +156 -156
- package/src/core/MPVenue.ts +293 -293
- package/src/core/MPVenueCollection.ts +57 -57
- package/src/core/MPVenueInfo.ts +61 -61
- package/src/core/MapControl.ts +876 -864
- package/src/core/MapView.tsx +33 -33
- package/src/core/MapsIndoors.ts +530 -530
- package/src/core/OnBuildingFoundAtCameraTargetListener.ts +16 -16
- package/src/core/OnFloorSelectionChangedListener.ts +16 -16
- package/src/core/OnFloorUpdateListener.ts +15 -15
- package/src/core/OnLegSelectedListener.ts +16 -16
- package/src/core/OnLiveLocationUpdateListener.ts +16 -16
- package/src/core/OnLocationSelectedListener.ts +16 -16
- package/src/core/OnMapClickListener.ts +19 -19
- package/src/core/OnMarkerClickListener.ts +16 -16
- package/src/core/OnMarkerInfoWindowClickListener.ts +16 -16
- package/src/core/OnPositionUpdateListener.ts +16 -16
- package/src/core/OnVenueFoundAtCameraTargetListener.ts +16 -16
- package/src/core/README.md +92 -92
- package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/jarRepositories.xml +0 -60
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/vcs.xml +0 -7
- package/android/local.properties +0 -8
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,183 +1,187 @@
|
|
|
1
|
-
# react-native-maps-indoors
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
allprojects
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
directionsService.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
The `
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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.3/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
|
+
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
gradle.version=7.4
|
|
1
|
+
#Mon Jun 26 10:23:28 CEST 2023
|
|
2
|
+
gradle.version=7.4
|
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
|