@mapsindoors/react-native-maps-indoors-mapbox 2.0.2 → 2.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.
- package/README.md +1 -1
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.idea/gradle.xml +2 -3
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +0 -1
- package/android/.idea/other.xml +263 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mapsindoorsrn/MapboxMapView.java +5 -0
- package/ios/MapsIndoorsViewManager.swift +16 -5
- package/ios/core/DirectionsRendererModule.swift +16 -16
- package/ios/core/MPDisplayRuleModule.swift +17 -0
- package/ios/core/MapControlModule.swift +48 -41
- package/ios/core/MapsIndoorsData.swift +1 -6
- package/ios/core/MapsIndoorsModule.swift +1 -1
- package/ios/core/RCMapView.swift +3 -1
- package/package.json +1 -1
- package/react-native-maps-indoors-mapbox.podspec +2 -2
- package/src/core/MPMapConfig.ts +18 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Documentation
|
|
4
4
|
|
|
5
|
-
Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.0.
|
|
5
|
+
Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.0.4/index.html) to get an overview of what the MapsIndoors SDK offers.
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/.idea/gradle.xml
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
<component name="GradleSettings">
|
|
5
5
|
<option name="linkedExternalProjectsSettings">
|
|
6
6
|
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="GRADLE" />
|
|
8
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
7
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
-
<option name="gradleJvm" value="
|
|
8
|
+
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
|
11
9
|
<option name="modules">
|
|
12
10
|
<set>
|
|
13
11
|
<option value="$PROJECT_DIR$" />
|
|
14
12
|
</set>
|
|
15
13
|
</option>
|
|
14
|
+
<option name="resolveExternalAnnotations" value="false" />
|
|
16
15
|
</GradleProjectSettings>
|
|
17
16
|
</option>
|
|
18
17
|
</component>
|
package/android/.idea/misc.xml
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
1
|
<project version="4">
|
|
3
2
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
3
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="direct_access_persist.xml">
|
|
4
|
+
<option name="deviceSelectionList">
|
|
5
|
+
<list>
|
|
6
|
+
<PersistentDeviceSelectionData>
|
|
7
|
+
<option name="api" value="27" />
|
|
8
|
+
<option name="brand" value="DOCOMO" />
|
|
9
|
+
<option name="codename" value="F01L" />
|
|
10
|
+
<option name="id" value="F01L" />
|
|
11
|
+
<option name="manufacturer" value="FUJITSU" />
|
|
12
|
+
<option name="name" value="F-01L" />
|
|
13
|
+
<option name="screenDensity" value="360" />
|
|
14
|
+
<option name="screenX" value="720" />
|
|
15
|
+
<option name="screenY" value="1280" />
|
|
16
|
+
</PersistentDeviceSelectionData>
|
|
17
|
+
<PersistentDeviceSelectionData>
|
|
18
|
+
<option name="api" value="28" />
|
|
19
|
+
<option name="brand" value="DOCOMO" />
|
|
20
|
+
<option name="codename" value="SH-01L" />
|
|
21
|
+
<option name="id" value="SH-01L" />
|
|
22
|
+
<option name="manufacturer" value="SHARP" />
|
|
23
|
+
<option name="name" value="AQUOS sense2 SH-01L" />
|
|
24
|
+
<option name="screenDensity" value="480" />
|
|
25
|
+
<option name="screenX" value="1080" />
|
|
26
|
+
<option name="screenY" value="2160" />
|
|
27
|
+
</PersistentDeviceSelectionData>
|
|
28
|
+
<PersistentDeviceSelectionData>
|
|
29
|
+
<option name="api" value="31" />
|
|
30
|
+
<option name="brand" value="samsung" />
|
|
31
|
+
<option name="codename" value="a51" />
|
|
32
|
+
<option name="id" value="a51" />
|
|
33
|
+
<option name="manufacturer" value="Samsung" />
|
|
34
|
+
<option name="name" value="Galaxy A51" />
|
|
35
|
+
<option name="screenDensity" value="420" />
|
|
36
|
+
<option name="screenX" value="1080" />
|
|
37
|
+
<option name="screenY" value="2400" />
|
|
38
|
+
</PersistentDeviceSelectionData>
|
|
39
|
+
<PersistentDeviceSelectionData>
|
|
40
|
+
<option name="api" value="34" />
|
|
41
|
+
<option name="brand" value="google" />
|
|
42
|
+
<option name="codename" value="akita" />
|
|
43
|
+
<option name="id" value="akita" />
|
|
44
|
+
<option name="manufacturer" value="Google" />
|
|
45
|
+
<option name="name" value="Pixel 8a" />
|
|
46
|
+
<option name="screenDensity" value="420" />
|
|
47
|
+
<option name="screenX" value="1080" />
|
|
48
|
+
<option name="screenY" value="2400" />
|
|
49
|
+
</PersistentDeviceSelectionData>
|
|
50
|
+
<PersistentDeviceSelectionData>
|
|
51
|
+
<option name="api" value="33" />
|
|
52
|
+
<option name="brand" value="samsung" />
|
|
53
|
+
<option name="codename" value="b0q" />
|
|
54
|
+
<option name="id" value="b0q" />
|
|
55
|
+
<option name="manufacturer" value="Samsung" />
|
|
56
|
+
<option name="name" value="Galaxy S22 Ultra" />
|
|
57
|
+
<option name="screenDensity" value="600" />
|
|
58
|
+
<option name="screenX" value="1440" />
|
|
59
|
+
<option name="screenY" value="3088" />
|
|
60
|
+
</PersistentDeviceSelectionData>
|
|
61
|
+
<PersistentDeviceSelectionData>
|
|
62
|
+
<option name="api" value="32" />
|
|
63
|
+
<option name="brand" value="google" />
|
|
64
|
+
<option name="codename" value="bluejay" />
|
|
65
|
+
<option name="id" value="bluejay" />
|
|
66
|
+
<option name="manufacturer" value="Google" />
|
|
67
|
+
<option name="name" value="Pixel 6a" />
|
|
68
|
+
<option name="screenDensity" value="420" />
|
|
69
|
+
<option name="screenX" value="1080" />
|
|
70
|
+
<option name="screenY" value="2400" />
|
|
71
|
+
</PersistentDeviceSelectionData>
|
|
72
|
+
<PersistentDeviceSelectionData>
|
|
73
|
+
<option name="api" value="29" />
|
|
74
|
+
<option name="brand" value="samsung" />
|
|
75
|
+
<option name="codename" value="crownqlteue" />
|
|
76
|
+
<option name="id" value="crownqlteue" />
|
|
77
|
+
<option name="manufacturer" value="Samsung" />
|
|
78
|
+
<option name="name" value="Galaxy Note9" />
|
|
79
|
+
<option name="screenDensity" value="420" />
|
|
80
|
+
<option name="screenX" value="2220" />
|
|
81
|
+
<option name="screenY" value="1080" />
|
|
82
|
+
</PersistentDeviceSelectionData>
|
|
83
|
+
<PersistentDeviceSelectionData>
|
|
84
|
+
<option name="api" value="34" />
|
|
85
|
+
<option name="brand" value="samsung" />
|
|
86
|
+
<option name="codename" value="dm3q" />
|
|
87
|
+
<option name="id" value="dm3q" />
|
|
88
|
+
<option name="manufacturer" value="Samsung" />
|
|
89
|
+
<option name="name" value="Galaxy S23 Ultra" />
|
|
90
|
+
<option name="screenDensity" value="600" />
|
|
91
|
+
<option name="screenX" value="1440" />
|
|
92
|
+
<option name="screenY" value="3088" />
|
|
93
|
+
</PersistentDeviceSelectionData>
|
|
94
|
+
<PersistentDeviceSelectionData>
|
|
95
|
+
<option name="api" value="33" />
|
|
96
|
+
<option name="brand" value="google" />
|
|
97
|
+
<option name="codename" value="felix" />
|
|
98
|
+
<option name="id" value="felix" />
|
|
99
|
+
<option name="manufacturer" value="Google" />
|
|
100
|
+
<option name="name" value="Pixel Fold" />
|
|
101
|
+
<option name="screenDensity" value="420" />
|
|
102
|
+
<option name="screenX" value="2208" />
|
|
103
|
+
<option name="screenY" value="1840" />
|
|
104
|
+
</PersistentDeviceSelectionData>
|
|
105
|
+
<PersistentDeviceSelectionData>
|
|
106
|
+
<option name="api" value="33" />
|
|
107
|
+
<option name="brand" value="google" />
|
|
108
|
+
<option name="codename" value="felix_camera" />
|
|
109
|
+
<option name="id" value="felix_camera" />
|
|
110
|
+
<option name="manufacturer" value="Google" />
|
|
111
|
+
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
|
112
|
+
<option name="screenDensity" value="420" />
|
|
113
|
+
<option name="screenX" value="2208" />
|
|
114
|
+
<option name="screenY" value="1840" />
|
|
115
|
+
</PersistentDeviceSelectionData>
|
|
116
|
+
<PersistentDeviceSelectionData>
|
|
117
|
+
<option name="api" value="33" />
|
|
118
|
+
<option name="brand" value="samsung" />
|
|
119
|
+
<option name="codename" value="gts8uwifi" />
|
|
120
|
+
<option name="id" value="gts8uwifi" />
|
|
121
|
+
<option name="manufacturer" value="Samsung" />
|
|
122
|
+
<option name="name" value="Galaxy Tab S8 Ultra" />
|
|
123
|
+
<option name="screenDensity" value="320" />
|
|
124
|
+
<option name="screenX" value="1848" />
|
|
125
|
+
<option name="screenY" value="2960" />
|
|
126
|
+
</PersistentDeviceSelectionData>
|
|
127
|
+
<PersistentDeviceSelectionData>
|
|
128
|
+
<option name="api" value="34" />
|
|
129
|
+
<option name="brand" value="google" />
|
|
130
|
+
<option name="codename" value="husky" />
|
|
131
|
+
<option name="id" value="husky" />
|
|
132
|
+
<option name="manufacturer" value="Google" />
|
|
133
|
+
<option name="name" value="Pixel 8 Pro" />
|
|
134
|
+
<option name="screenDensity" value="390" />
|
|
135
|
+
<option name="screenX" value="1008" />
|
|
136
|
+
<option name="screenY" value="2244" />
|
|
137
|
+
</PersistentDeviceSelectionData>
|
|
138
|
+
<PersistentDeviceSelectionData>
|
|
139
|
+
<option name="api" value="30" />
|
|
140
|
+
<option name="brand" value="motorola" />
|
|
141
|
+
<option name="codename" value="java" />
|
|
142
|
+
<option name="id" value="java" />
|
|
143
|
+
<option name="manufacturer" value="Motorola" />
|
|
144
|
+
<option name="name" value="G20" />
|
|
145
|
+
<option name="screenDensity" value="280" />
|
|
146
|
+
<option name="screenX" value="720" />
|
|
147
|
+
<option name="screenY" value="1600" />
|
|
148
|
+
</PersistentDeviceSelectionData>
|
|
149
|
+
<PersistentDeviceSelectionData>
|
|
150
|
+
<option name="api" value="33" />
|
|
151
|
+
<option name="brand" value="google" />
|
|
152
|
+
<option name="codename" value="lynx" />
|
|
153
|
+
<option name="id" value="lynx" />
|
|
154
|
+
<option name="manufacturer" value="Google" />
|
|
155
|
+
<option name="name" value="Pixel 7a" />
|
|
156
|
+
<option name="screenDensity" value="420" />
|
|
157
|
+
<option name="screenX" value="1080" />
|
|
158
|
+
<option name="screenY" value="2400" />
|
|
159
|
+
</PersistentDeviceSelectionData>
|
|
160
|
+
<PersistentDeviceSelectionData>
|
|
161
|
+
<option name="api" value="31" />
|
|
162
|
+
<option name="brand" value="google" />
|
|
163
|
+
<option name="codename" value="oriole" />
|
|
164
|
+
<option name="id" value="oriole" />
|
|
165
|
+
<option name="manufacturer" value="Google" />
|
|
166
|
+
<option name="name" value="Pixel 6" />
|
|
167
|
+
<option name="screenDensity" value="420" />
|
|
168
|
+
<option name="screenX" value="1080" />
|
|
169
|
+
<option name="screenY" value="2400" />
|
|
170
|
+
</PersistentDeviceSelectionData>
|
|
171
|
+
<PersistentDeviceSelectionData>
|
|
172
|
+
<option name="api" value="33" />
|
|
173
|
+
<option name="brand" value="google" />
|
|
174
|
+
<option name="codename" value="panther" />
|
|
175
|
+
<option name="id" value="panther" />
|
|
176
|
+
<option name="manufacturer" value="Google" />
|
|
177
|
+
<option name="name" value="Pixel 7" />
|
|
178
|
+
<option name="screenDensity" value="420" />
|
|
179
|
+
<option name="screenX" value="1080" />
|
|
180
|
+
<option name="screenY" value="2400" />
|
|
181
|
+
</PersistentDeviceSelectionData>
|
|
182
|
+
<PersistentDeviceSelectionData>
|
|
183
|
+
<option name="api" value="31" />
|
|
184
|
+
<option name="brand" value="samsung" />
|
|
185
|
+
<option name="codename" value="q2q" />
|
|
186
|
+
<option name="id" value="q2q" />
|
|
187
|
+
<option name="manufacturer" value="Samsung" />
|
|
188
|
+
<option name="name" value="Galaxy Z Fold3" />
|
|
189
|
+
<option name="screenDensity" value="420" />
|
|
190
|
+
<option name="screenX" value="1768" />
|
|
191
|
+
<option name="screenY" value="2208" />
|
|
192
|
+
</PersistentDeviceSelectionData>
|
|
193
|
+
<PersistentDeviceSelectionData>
|
|
194
|
+
<option name="api" value="34" />
|
|
195
|
+
<option name="brand" value="samsung" />
|
|
196
|
+
<option name="codename" value="q5q" />
|
|
197
|
+
<option name="id" value="q5q" />
|
|
198
|
+
<option name="manufacturer" value="Samsung" />
|
|
199
|
+
<option name="name" value="Galaxy Z Fold5" />
|
|
200
|
+
<option name="screenDensity" value="420" />
|
|
201
|
+
<option name="screenX" value="1812" />
|
|
202
|
+
<option name="screenY" value="2176" />
|
|
203
|
+
</PersistentDeviceSelectionData>
|
|
204
|
+
<PersistentDeviceSelectionData>
|
|
205
|
+
<option name="api" value="30" />
|
|
206
|
+
<option name="brand" value="google" />
|
|
207
|
+
<option name="codename" value="r11" />
|
|
208
|
+
<option name="id" value="r11" />
|
|
209
|
+
<option name="manufacturer" value="Google" />
|
|
210
|
+
<option name="name" value="Pixel Watch" />
|
|
211
|
+
<option name="screenDensity" value="320" />
|
|
212
|
+
<option name="screenX" value="384" />
|
|
213
|
+
<option name="screenY" value="384" />
|
|
214
|
+
<option name="type" value="WEAR_OS" />
|
|
215
|
+
</PersistentDeviceSelectionData>
|
|
216
|
+
<PersistentDeviceSelectionData>
|
|
217
|
+
<option name="api" value="30" />
|
|
218
|
+
<option name="brand" value="google" />
|
|
219
|
+
<option name="codename" value="redfin" />
|
|
220
|
+
<option name="id" value="redfin" />
|
|
221
|
+
<option name="manufacturer" value="Google" />
|
|
222
|
+
<option name="name" value="Pixel 5" />
|
|
223
|
+
<option name="screenDensity" value="440" />
|
|
224
|
+
<option name="screenX" value="1080" />
|
|
225
|
+
<option name="screenY" value="2340" />
|
|
226
|
+
</PersistentDeviceSelectionData>
|
|
227
|
+
<PersistentDeviceSelectionData>
|
|
228
|
+
<option name="api" value="34" />
|
|
229
|
+
<option name="brand" value="google" />
|
|
230
|
+
<option name="codename" value="shiba" />
|
|
231
|
+
<option name="id" value="shiba" />
|
|
232
|
+
<option name="manufacturer" value="Google" />
|
|
233
|
+
<option name="name" value="Pixel 8" />
|
|
234
|
+
<option name="screenDensity" value="420" />
|
|
235
|
+
<option name="screenX" value="1080" />
|
|
236
|
+
<option name="screenY" value="2400" />
|
|
237
|
+
</PersistentDeviceSelectionData>
|
|
238
|
+
<PersistentDeviceSelectionData>
|
|
239
|
+
<option name="api" value="33" />
|
|
240
|
+
<option name="brand" value="google" />
|
|
241
|
+
<option name="codename" value="tangorpro" />
|
|
242
|
+
<option name="id" value="tangorpro" />
|
|
243
|
+
<option name="manufacturer" value="Google" />
|
|
244
|
+
<option name="name" value="Pixel Tablet" />
|
|
245
|
+
<option name="screenDensity" value="320" />
|
|
246
|
+
<option name="screenX" value="1600" />
|
|
247
|
+
<option name="screenY" value="2560" />
|
|
248
|
+
</PersistentDeviceSelectionData>
|
|
249
|
+
<PersistentDeviceSelectionData>
|
|
250
|
+
<option name="api" value="29" />
|
|
251
|
+
<option name="brand" value="samsung" />
|
|
252
|
+
<option name="codename" value="x1q" />
|
|
253
|
+
<option name="id" value="x1q" />
|
|
254
|
+
<option name="manufacturer" value="Samsung" />
|
|
255
|
+
<option name="name" value="Galaxy S20" />
|
|
256
|
+
<option name="screenDensity" value="480" />
|
|
257
|
+
<option name="screenX" value="1440" />
|
|
258
|
+
<option name="screenY" value="3200" />
|
|
259
|
+
</PersistentDeviceSelectionData>
|
|
260
|
+
</list>
|
|
261
|
+
</option>
|
|
262
|
+
</component>
|
|
263
|
+
</project>
|
package/android/build.gradle
CHANGED
|
@@ -93,7 +93,7 @@ dependencies {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
implementation 'com.mapbox.maps:android:11.4.0'
|
|
96
|
-
implementation 'com.mapspeople.mapsindoors:mapbox-v11:4.8.
|
|
96
|
+
implementation 'com.mapspeople.mapsindoors:mapbox-v11:4.8.7'
|
|
97
97
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
98
98
|
implementation 'androidx.core:core-ktx:1.3.2'
|
|
99
99
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
|
@@ -86,10 +86,15 @@ public class MapboxMapView implements RCMapView {
|
|
|
86
86
|
if (configMap.hasKey("mapsIndoorsTransitionLevel")) {
|
|
87
87
|
config.setMapsIndoorsTransitionLevel(configMap.getInt("mapsIndoorsTransitionLevel"));
|
|
88
88
|
}
|
|
89
|
+
|
|
89
90
|
if (configMap.hasKey("showMapMarkers")) {
|
|
90
91
|
config.showMapMarkers(configMap.getBoolean("showMapMarkers"));
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
if (configMap.hasKey("showRoadLabels")) {
|
|
95
|
+
config.showRoadLabels(configMap.getBoolean("showRoadLabels"));
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
return config.build();
|
|
94
99
|
}
|
|
95
100
|
|
|
@@ -31,14 +31,23 @@ class MapsIndoorsViewManager : RCTViewManager {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
class MapBoxView: RCMapView {
|
|
35
35
|
|
|
36
36
|
private let mapboxView: MapView
|
|
37
|
+
private var mMapControl: MPMapControl? = nil
|
|
37
38
|
|
|
38
39
|
init(mapboxView: MapView) {
|
|
39
40
|
self.mapboxView = mapboxView
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
internal func getMapControl() -> MPMapControl? {
|
|
44
|
+
return mMapControl
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
func setMapControl(mapControl: any MapsIndoors.MPMapControl) {
|
|
48
|
+
mMapControl = mapControl
|
|
49
|
+
}
|
|
50
|
+
|
|
42
51
|
private func makeCameraUpdate(cameraUpdate: CameraUpdate) throws -> CameraOptions {
|
|
43
52
|
var update: CameraOptions
|
|
44
53
|
|
|
@@ -93,7 +102,7 @@ struct MapBoxView: RCMapView {
|
|
|
93
102
|
|
|
94
103
|
cameraOption = try makeCameraUpdate(cameraUpdate: cameraUpdate)
|
|
95
104
|
|
|
96
|
-
DispatchQueue.main.async {
|
|
105
|
+
DispatchQueue.main.async { [self] in
|
|
97
106
|
if (duration != 0) {
|
|
98
107
|
mapboxView.mapboxMap.setCamera(to: cameraOption)
|
|
99
108
|
} else {
|
|
@@ -107,7 +116,7 @@ struct MapBoxView: RCMapView {
|
|
|
107
116
|
|
|
108
117
|
cameraOption = try makeCameraUpdate(cameraUpdate: cameraUpdate)
|
|
109
118
|
|
|
110
|
-
DispatchQueue.main.async {
|
|
119
|
+
DispatchQueue.main.async { [self] in
|
|
111
120
|
mapboxView.mapboxMap.setCamera(to: cameraOption)
|
|
112
121
|
}
|
|
113
122
|
}
|
|
@@ -118,8 +127,10 @@ struct MapBoxView: RCMapView {
|
|
|
118
127
|
mapConfig.setMapsIndoorsTransitionLevel(zoom: zoom.intValue)
|
|
119
128
|
}
|
|
120
129
|
if let showMapMarkers = config["showMapMarkers"] as? Bool {
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
mapConfig.setShowMapMarkers(show: showMapMarkers)
|
|
131
|
+
}
|
|
132
|
+
if let showRoadLabels = config["showRoadLabels"] as? Bool {
|
|
133
|
+
mapConfig.setShowRoadLabels(show: showRoadLabels)
|
|
123
134
|
}
|
|
124
135
|
return mapConfig
|
|
125
136
|
}
|
|
@@ -26,7 +26,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
26
26
|
|
|
27
27
|
@objc public func clear(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
28
28
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
29
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
29
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
30
30
|
animationDuration = 5
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
44
44
|
|
|
45
45
|
@objc public func getSelectedLegFloorIndex(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
46
46
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
47
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
47
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -53,7 +53,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
53
53
|
return doReject(reject, message: "directions renderer null. MapControl needs to have been instantiated first")
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
directionsRenderer.padding = MapsIndoorsData.sharedInstance.
|
|
56
|
+
directionsRenderer.padding = MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.mapPadding
|
|
57
57
|
|
|
58
58
|
guard let legIndex = directionsRenderer.route?.legs[directionsRenderer.routeLegIndex].end_location.zLevel.int32Value else {
|
|
59
59
|
return doReject(reject, message: "No current floor available")
|
|
@@ -64,7 +64,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
64
64
|
|
|
65
65
|
@objc public func nextLeg(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
66
66
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
67
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
67
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -74,7 +74,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
74
74
|
return doReject(reject, message: "directions renderer null. MapControl needs to have been instantiated first")
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
directionsRenderer.padding = MapsIndoorsData.sharedInstance.
|
|
77
|
+
directionsRenderer.padding = MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.mapPadding
|
|
78
78
|
|
|
79
79
|
DispatchQueue.main.sync {
|
|
80
80
|
let succes = directionsRenderer.nextLeg()
|
|
@@ -91,7 +91,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
91
91
|
|
|
92
92
|
@objc public func previousLeg(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
93
93
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
94
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
94
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -101,7 +101,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
101
101
|
return doReject(reject, message: "directions renderer null. MapControl needs to have been instantiated first")
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
directionsRenderer.padding = MapsIndoorsData.sharedInstance.
|
|
104
|
+
directionsRenderer.padding = MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.mapPadding
|
|
105
105
|
|
|
106
106
|
DispatchQueue.main.sync {
|
|
107
107
|
let succes = directionsRenderer.previousLeg()
|
|
@@ -119,7 +119,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
119
119
|
|
|
120
120
|
@objc public func selectLegIndex(_ legIndex: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
121
121
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
122
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
122
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -141,7 +141,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
141
141
|
return doReject(reject, message: "Tried to select route leg index \(legIndex.intValue) outside of range 0..\((route.legs.count)-1)")
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
directionsRenderer.padding = MapsIndoorsData.sharedInstance.
|
|
144
|
+
directionsRenderer.padding = MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.mapPadding
|
|
145
145
|
|
|
146
146
|
DispatchQueue.main.sync {
|
|
147
147
|
directionsRenderer.routeLegIndex = legIndex.intValue
|
|
@@ -157,7 +157,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
157
157
|
|
|
158
158
|
@objc public func setAnimatedPolyline(_ animated: Bool, repeated: Bool, duration: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
159
159
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
160
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
160
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -178,7 +178,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
178
178
|
|
|
179
179
|
@objc public func showRouteLegButtons(_ value: Bool, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
180
180
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
181
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
181
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -195,7 +195,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
195
195
|
|
|
196
196
|
@objc public func setCameraAnimationDuration(_ duration: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
197
197
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
198
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
198
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -212,7 +212,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
212
212
|
|
|
213
213
|
@objc public func setCameraViewFitMode(_ cameraFitMode: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
214
214
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
215
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
215
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -243,7 +243,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
243
243
|
|
|
244
244
|
@objc public func setDefaultRouteStopIcon(_ defaultIcon: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
245
245
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
246
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
246
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -287,7 +287,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
287
287
|
|
|
288
288
|
@objc public func setRoute(_ routeString: String, stopIcons: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
289
289
|
if (MapsIndoorsData.sharedInstance.directionsRenderer == nil) {
|
|
290
|
-
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.
|
|
290
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.newDirectionsRenderer()
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
let directionsRenderer = MapsIndoorsData.sharedInstance.directionsRenderer
|
|
@@ -297,7 +297,7 @@ public class DirectionsRendererModule: RCTEventEmitter {
|
|
|
297
297
|
return doReject(reject, message: "directions renderer null. MapControl needs to have been instantiated first")
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
directionsRenderer.padding = MapsIndoorsData.sharedInstance.
|
|
300
|
+
directionsRenderer.padding = MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.mapPadding
|
|
301
301
|
|
|
302
302
|
guard let route = try? JSONDecoder().decode(MPRouteInternal.self, from: Data(routeString.utf8)) else {
|
|
303
303
|
return doReject(reject, message: "Route could not be parsed")
|
|
@@ -20,6 +20,8 @@ private func doReject(_ reject: RCTPromiseRejectBlock, displayRuleId: String,
|
|
|
20
20
|
|
|
21
21
|
@objc(DisplayRule)
|
|
22
22
|
public class MPDisplayRuleModule: NSObject {
|
|
23
|
+
private var refreshTimerWorkItem: DispatchWorkItem?
|
|
24
|
+
|
|
23
25
|
@objc static func requiresMainQueueSetup() -> Bool { return false }
|
|
24
26
|
|
|
25
27
|
private func getIconPlacement(iconPlacement: NSNumber) -> MPIconPlacement {
|
|
@@ -87,16 +89,31 @@ public class MPDisplayRuleModule: NSObject {
|
|
|
87
89
|
|
|
88
90
|
private func getRule(name: String) -> MPDisplayRule? {
|
|
89
91
|
if let typeRule = getTypeRule(typeName: name) {
|
|
92
|
+
setRefreshTimer()
|
|
90
93
|
return MPMapsIndoors.shared.displayRuleFor(displayRuleType: typeRule)
|
|
91
94
|
} else if let namedRule = MPMapsIndoors.shared.displayRuleFor(type: name.lowercased()){
|
|
95
|
+
setRefreshTimer()
|
|
92
96
|
return namedRule
|
|
93
97
|
} else if let loc = MPMapsIndoors.shared.locationWith(locationId: name) {
|
|
98
|
+
setRefreshTimer()
|
|
94
99
|
return MPMapsIndoors.shared.displayRuleFor(location: loc)!
|
|
95
100
|
} else {
|
|
96
101
|
return nil
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
|
|
105
|
+
func setRefreshTimer() {
|
|
106
|
+
refreshTimerWorkItem?.cancel()
|
|
107
|
+
|
|
108
|
+
refreshTimerWorkItem = DispatchWorkItem {
|
|
109
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.refresh()
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if let refreshTimerWorkItem {
|
|
113
|
+
DispatchQueue.global().asyncAfter(deadline: .now() + 0.5, execute: refreshTimerWorkItem)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
100
117
|
func hexStringFromColor(color: UIColor) -> String {
|
|
101
118
|
// TODO: copy paste from Flutter
|
|
102
119
|
let components = color.cgColor.components
|
|
@@ -41,18 +41,25 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
41
41
|
return doReject(reject, message: "Mapview not available")
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
if mapView.getMapControl() != nil {
|
|
45
|
+
MapsIndoorsData.sharedInstance.directionsRenderer?.clear()
|
|
46
|
+
MapsIndoorsData.sharedInstance.directionsRenderer = nil
|
|
47
|
+
return resolve(nil)
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
self.mapConfig = mapView.getConfig(config: config)
|
|
45
51
|
|
|
46
52
|
guard let mapControl = MPMapsIndoors.createMapControl(mapConfig: self.mapConfig!) else {
|
|
47
53
|
return doReject(reject, message: "Unable to initialize Map Control")
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
|
|
50
57
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
51
58
|
|
|
52
59
|
if (mapsIndoorsData.mapControlListenerDelegate == nil) {
|
|
53
60
|
mapsIndoorsData.mapControlListenerDelegate = MapControlDelegate(eventEmitter: self)
|
|
54
61
|
}
|
|
55
|
-
|
|
62
|
+
mapView.setMapControl(mapControl: mapControl)
|
|
56
63
|
mapControl.delegate = mapsIndoorsData.mapControlListenerDelegate
|
|
57
64
|
|
|
58
65
|
|
|
@@ -63,7 +70,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
63
70
|
@objc public func clearFilter(_ resolve: @escaping RCTPromiseResolveBlock,
|
|
64
71
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
65
72
|
DispatchQueue.main.async {
|
|
66
|
-
MapsIndoorsData.sharedInstance.
|
|
73
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.clearFilter()
|
|
67
74
|
return resolve(nil)
|
|
68
75
|
}
|
|
69
76
|
}
|
|
@@ -76,7 +83,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
76
83
|
let filter: MPFilter = try fromJSON(filterJSON)
|
|
77
84
|
let filterBehavior: MPFilterBehavior = try fromJSON(filterBehaviorJSON)
|
|
78
85
|
|
|
79
|
-
MapsIndoorsData.sharedInstance.
|
|
86
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.setFilter(filter: filter, behavior: filterBehavior)
|
|
80
87
|
return resolve(true)
|
|
81
88
|
} catch let e {
|
|
82
89
|
return doReject(reject, error: e)
|
|
@@ -92,7 +99,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
92
99
|
let filterBehavior: MPFilterBehavior = try fromJSON(filterBehaviorJSON)
|
|
93
100
|
let locs = (locations.compactMap{MPMapsIndoors.shared.locationWith(locationId: $0)})
|
|
94
101
|
|
|
95
|
-
MapsIndoorsData.sharedInstance.
|
|
102
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.setFilter(locations: locs, behavior: filterBehavior)
|
|
96
103
|
|
|
97
104
|
return resolve(true)
|
|
98
105
|
} catch let e {
|
|
@@ -109,7 +116,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
109
116
|
let highlightBehavior: MPHighlightBehavior = try fromJSON(highlightBehaviorJSON)
|
|
110
117
|
let locs = (locations.compactMap{MPMapsIndoors.shared.locationWith(locationId: $0)})
|
|
111
118
|
|
|
112
|
-
MapsIndoorsData.sharedInstance.
|
|
119
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.setHighlight(locations: locs, behavior: highlightBehavior)
|
|
113
120
|
|
|
114
121
|
return resolve(true)
|
|
115
122
|
} catch let e {
|
|
@@ -120,7 +127,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
120
127
|
@objc public func clearHighlight(_ resolve: @escaping RCTPromiseResolveBlock,
|
|
121
128
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
122
129
|
DispatchQueue.main.async {
|
|
123
|
-
MapsIndoorsData.sharedInstance.
|
|
130
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.clearHighlight()
|
|
124
131
|
return resolve(nil)
|
|
125
132
|
}
|
|
126
133
|
}
|
|
@@ -128,13 +135,13 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
128
135
|
@objc public func showUserPosition(_ show: Bool,
|
|
129
136
|
resolver resolve: RCTPromiseResolveBlock,
|
|
130
137
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
131
|
-
MapsIndoorsData.sharedInstance.
|
|
138
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.showUserPosition = show
|
|
132
139
|
return resolve(nil)
|
|
133
140
|
}
|
|
134
141
|
|
|
135
142
|
@objc public func isUserPositionShown(_ resolve: RCTPromiseResolveBlock,
|
|
136
143
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
137
|
-
return resolve(MapsIndoorsData.sharedInstance.
|
|
144
|
+
return resolve(MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.showUserPosition)
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
@objc public func goTo(_ entityJSON: String,
|
|
@@ -159,7 +166,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
159
166
|
}
|
|
160
167
|
|
|
161
168
|
DispatchQueue.main.async {
|
|
162
|
-
MapsIndoorsData.sharedInstance.
|
|
169
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.goTo(entity: entity)
|
|
163
170
|
return resolve(nil)
|
|
164
171
|
}
|
|
165
172
|
} catch let e {
|
|
@@ -169,7 +176,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
169
176
|
|
|
170
177
|
@objc public func getCurrentVenue(_ resolve: RCTPromiseResolveBlock,
|
|
171
178
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
172
|
-
if let currentVenue = MapsIndoorsData.sharedInstance.
|
|
179
|
+
if let currentVenue = MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.currentVenue {
|
|
173
180
|
return resolve(toJSON(MPVenueCodable(withVenue: currentVenue)))
|
|
174
181
|
} else {
|
|
175
182
|
return resolve(nil)
|
|
@@ -179,7 +186,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
179
186
|
|
|
180
187
|
@objc public func getCurrentBuilding(_ resolve: RCTPromiseResolveBlock,
|
|
181
188
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
182
|
-
if let currentBuilding = MapsIndoorsData.sharedInstance.
|
|
189
|
+
if let currentBuilding = MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.currentBuilding {
|
|
183
190
|
return resolve(toJSON(MPBuildingCodable(withBuilding: currentBuilding)))
|
|
184
191
|
} else {
|
|
185
192
|
return resolve(nil)
|
|
@@ -195,7 +202,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
195
202
|
behavior.moveCamera = moveCamera
|
|
196
203
|
|
|
197
204
|
DispatchQueue.main.async {
|
|
198
|
-
MapsIndoorsData.sharedInstance.
|
|
205
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(venue: venue, behavior: behavior)
|
|
199
206
|
return resolve(nil)
|
|
200
207
|
}
|
|
201
208
|
} catch let e {
|
|
@@ -212,7 +219,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
212
219
|
behavior.moveCamera = moveCamera
|
|
213
220
|
|
|
214
221
|
DispatchQueue.main.async {
|
|
215
|
-
MapsIndoorsData.sharedInstance.
|
|
222
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(building: building, behavior: behavior)
|
|
216
223
|
return resolve(nil)
|
|
217
224
|
}
|
|
218
225
|
} catch let e {
|
|
@@ -231,7 +238,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
231
238
|
Task {
|
|
232
239
|
let loc = MPMapsIndoors.shared.locationWith(locationId: location.locationId)
|
|
233
240
|
DispatchQueue.main.async {
|
|
234
|
-
MapsIndoorsData.sharedInstance.
|
|
241
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(location: loc, behavior: behavior)
|
|
235
242
|
return resolve(nil)
|
|
236
243
|
}
|
|
237
244
|
}
|
|
@@ -249,7 +256,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
249
256
|
let behavior: MPSelectionBehavior = try fromJSON(behaviorJSON)
|
|
250
257
|
|
|
251
258
|
DispatchQueue.main.async {
|
|
252
|
-
MapsIndoorsData.sharedInstance.
|
|
259
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(location: location, behavior: behavior)
|
|
253
260
|
return resolve(nil)
|
|
254
261
|
}
|
|
255
262
|
|
|
@@ -265,35 +272,35 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
265
272
|
let edgeInsets = UIEdgeInsets(top: CGFloat(top), left: CGFloat(left), bottom: CGFloat(bottom), right: CGFloat(right))
|
|
266
273
|
|
|
267
274
|
DispatchQueue.main.async {
|
|
268
|
-
MapsIndoorsData.sharedInstance.
|
|
275
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.mapPadding = edgeInsets
|
|
269
276
|
return resolve(nil)
|
|
270
277
|
}
|
|
271
278
|
}
|
|
272
279
|
|
|
273
280
|
@objc public func getMapViewPaddingStart(_ resolve: RCTPromiseResolveBlock,
|
|
274
281
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
275
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
282
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
276
283
|
return doReject(reject, message: "mapcontrol not available")
|
|
277
284
|
}
|
|
278
285
|
return resolve(mapControl.mapPadding.left)
|
|
279
286
|
}
|
|
280
287
|
@objc public func getMapViewPaddingEnd(_ resolve: RCTPromiseResolveBlock,
|
|
281
288
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
282
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
289
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
283
290
|
return doReject(reject, message: "mapcontrol not available")
|
|
284
291
|
}
|
|
285
292
|
return resolve(mapControl.mapPadding.right)
|
|
286
293
|
}
|
|
287
294
|
@objc public func getMapViewPaddingTop(_ resolve: RCTPromiseResolveBlock,
|
|
288
295
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
289
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
296
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
290
297
|
return doReject(reject, message: "mapcontrol not available")
|
|
291
298
|
}
|
|
292
299
|
return resolve(mapControl.mapPadding.top)
|
|
293
300
|
}
|
|
294
301
|
@objc public func getMapViewPaddingBottom(_ resolve: RCTPromiseResolveBlock,
|
|
295
302
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
296
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
303
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
297
304
|
return doReject(reject, message: "mapcontrol not available")
|
|
298
305
|
}
|
|
299
306
|
return resolve(mapControl.mapPadding.bottom)
|
|
@@ -304,7 +311,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
304
311
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
305
312
|
do {
|
|
306
313
|
let mapStyle: MPMapStyleCodable = try fromJSON(mapStyleJSON)
|
|
307
|
-
MapsIndoorsData.sharedInstance.
|
|
314
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.mapStyle = mapStyle
|
|
308
315
|
return resolve(nil)
|
|
309
316
|
} catch let e {
|
|
310
317
|
return doReject(reject, error: e)
|
|
@@ -313,7 +320,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
313
320
|
|
|
314
321
|
@objc public func getMapStyle(_ resolve: RCTPromiseResolveBlock,
|
|
315
322
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
316
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
323
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
317
324
|
return doReject(reject, message: "mapControl not available")
|
|
318
325
|
}
|
|
319
326
|
|
|
@@ -324,21 +331,21 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
324
331
|
@objc public func showInfoWindowOnClickedLocation(_ show: Bool,
|
|
325
332
|
resolver resolve: RCTPromiseResolveBlock,
|
|
326
333
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
327
|
-
MapsIndoorsData.sharedInstance.
|
|
334
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.showInfoWindowOnClickedLocation = show
|
|
328
335
|
return resolve(nil)
|
|
329
336
|
}
|
|
330
337
|
|
|
331
338
|
@objc public func deSelectLocation(_ resolve: @escaping RCTPromiseResolveBlock,
|
|
332
339
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
333
340
|
DispatchQueue.main.async {
|
|
334
|
-
MapsIndoorsData.sharedInstance.
|
|
341
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(location: nil, behavior: .default)
|
|
335
342
|
return resolve(nil)
|
|
336
343
|
}
|
|
337
344
|
}
|
|
338
345
|
|
|
339
346
|
@objc public func getCurrentBuildingFloor(_ resolve: RCTPromiseResolveBlock,
|
|
340
347
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
341
|
-
guard let curFloor = MapsIndoorsData.sharedInstance.
|
|
348
|
+
guard let curFloor = MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.currentBuilding?.currentFloor else {
|
|
342
349
|
return resolve(nil)
|
|
343
350
|
}
|
|
344
351
|
|
|
@@ -347,32 +354,32 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
347
354
|
|
|
348
355
|
@objc public func getCurrentFloorIndex(_ resolve: RCTPromiseResolveBlock,
|
|
349
356
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
350
|
-
return resolve(MapsIndoorsData.sharedInstance.
|
|
357
|
+
return resolve(MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.currentFloorIndex)
|
|
351
358
|
}
|
|
352
359
|
|
|
353
360
|
@objc public func getCurrentMapsIndoorsZoom(_ resolve: RCTPromiseResolveBlock,
|
|
354
361
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
355
|
-
return resolve(MapsIndoorsData.sharedInstance.
|
|
362
|
+
return resolve(MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.cameraPosition.zoom)
|
|
356
363
|
}
|
|
357
364
|
|
|
358
365
|
@objc public func selectFloor(_ floorIndex: Int,
|
|
359
366
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
360
367
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
361
368
|
DispatchQueue.main.async {
|
|
362
|
-
MapsIndoorsData.sharedInstance.
|
|
369
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.select(floorIndex: floorIndex)
|
|
363
370
|
return resolve(nil)
|
|
364
371
|
}
|
|
365
372
|
}
|
|
366
373
|
|
|
367
374
|
@objc public func isFloorSelectorHidden(_ resolve: RCTPromiseResolveBlock,
|
|
368
375
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
369
|
-
return resolve(MapsIndoorsData.sharedInstance.
|
|
376
|
+
return resolve(MapsIndoorsData.sharedInstance.mapView?.getMapControl()!.hideFloorSelector)
|
|
370
377
|
}
|
|
371
378
|
|
|
372
379
|
@objc public func hideFloorSelector(_ hide: Bool,
|
|
373
380
|
resolver resolve: RCTPromiseResolveBlock,
|
|
374
381
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
375
|
-
MapsIndoorsData.sharedInstance.
|
|
382
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.hideFloorSelector = hide
|
|
376
383
|
return resolve(nil)
|
|
377
384
|
}
|
|
378
385
|
|
|
@@ -419,7 +426,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
419
426
|
@objc public func getCurrentCameraPosition(_ resolve: @escaping RCTPromiseResolveBlock,
|
|
420
427
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
421
428
|
DispatchQueue.main.async {
|
|
422
|
-
return resolve(toJSON(MPCameraPositionCodable(withCameraPosition: MapsIndoorsData.sharedInstance.
|
|
429
|
+
return resolve(toJSON(MPCameraPositionCodable(withCameraPosition: MapsIndoorsData.sharedInstance.mapView!.getMapControl()!.cameraPosition)))
|
|
423
430
|
}
|
|
424
431
|
}
|
|
425
432
|
|
|
@@ -429,7 +436,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
429
436
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
430
437
|
|
|
431
438
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
432
|
-
guard let mapControl = mapsIndoorsData.
|
|
439
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
433
440
|
return doReject(reject, message: "mapControl not available")
|
|
434
441
|
}
|
|
435
442
|
|
|
@@ -442,7 +449,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
442
449
|
resolver resolve: RCTPromiseResolveBlock,
|
|
443
450
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
444
451
|
|
|
445
|
-
MapsIndoorsData.sharedInstance.
|
|
452
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.disableLiveData(domain: domainType)
|
|
446
453
|
return resolve(nil)
|
|
447
454
|
}
|
|
448
455
|
|
|
@@ -514,7 +521,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
514
521
|
|
|
515
522
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
516
523
|
|
|
517
|
-
guard let mapControl = mapsIndoorsData.
|
|
524
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
518
525
|
return doReject(reject, message: "mapControl is not available")
|
|
519
526
|
}
|
|
520
527
|
|
|
@@ -558,7 +565,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
558
565
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
559
566
|
|
|
560
567
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
561
|
-
guard let mapControl = mapsIndoorsData.
|
|
568
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
562
569
|
return doReject(reject, message: "mapControl is not available")
|
|
563
570
|
}
|
|
564
571
|
|
|
@@ -592,7 +599,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
592
599
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
593
600
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
594
601
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
595
|
-
guard let mapControl = mapsIndoorsData.
|
|
602
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
596
603
|
return doReject(reject, message: "mapControl is not available")
|
|
597
604
|
}
|
|
598
605
|
|
|
@@ -602,7 +609,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
602
609
|
|
|
603
610
|
@objc public func getBuildingSelectionMode(_ resolve: RCTPromiseResolveBlock,
|
|
604
611
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
605
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
612
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
606
613
|
return doReject(reject, message: "mapControl is not available")
|
|
607
614
|
}
|
|
608
615
|
|
|
@@ -613,7 +620,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
613
620
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
614
621
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
615
622
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
616
|
-
guard let mapControl = mapsIndoorsData.
|
|
623
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
617
624
|
return doReject(reject, message: "mapControl is not available")
|
|
618
625
|
}
|
|
619
626
|
|
|
@@ -623,7 +630,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
623
630
|
|
|
624
631
|
@objc public func getFloorSelectionMode(_ resolve: RCTPromiseResolveBlock,
|
|
625
632
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
626
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
633
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
627
634
|
return doReject(reject, message: "mapControl is not available")
|
|
628
635
|
}
|
|
629
636
|
|
|
@@ -634,7 +641,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
634
641
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
635
642
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
636
643
|
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
637
|
-
guard let mapControl = mapsIndoorsData.
|
|
644
|
+
guard let mapControl = mapsIndoorsData.mapView?.getMapControl() else {
|
|
638
645
|
return doReject(reject, message: "mapControl is not available")
|
|
639
646
|
}
|
|
640
647
|
|
|
@@ -657,7 +664,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
657
664
|
|
|
658
665
|
@objc public func getHiddenFeatures(_ resolve: RCTPromiseResolveBlock,
|
|
659
666
|
rejecter reject: RCTPromiseRejectBlock) {
|
|
660
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
667
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
661
668
|
return doReject(reject, message: "mapControl is not available")
|
|
662
669
|
}
|
|
663
670
|
|
|
@@ -11,11 +11,6 @@ class MapsIndoorsData {
|
|
|
11
11
|
public static var sharedInstance = MapsIndoorsData()
|
|
12
12
|
|
|
13
13
|
public var mapView: RCMapView?
|
|
14
|
-
public var mapControl: MPMapControl? {
|
|
15
|
-
didSet {
|
|
16
|
-
directionsRenderer = nil
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
14
|
public var directionsRenderer: MPDirectionsRenderer? = nil
|
|
20
15
|
public var isInitialized: Bool = false
|
|
21
16
|
|
|
@@ -200,7 +195,7 @@ class FloorSelector: UIView, MPCustomFloorSelector {
|
|
|
200
195
|
|
|
201
196
|
func onFloorSelectionChanged(newFloor: MPFloorCodable) {
|
|
202
197
|
let floorIndex = newFloor.floorIndex?.intValue ?? 0
|
|
203
|
-
MapsIndoorsData.sharedInstance.
|
|
198
|
+
MapsIndoorsData.sharedInstance.mapView?.getMapControl()?.select(floorIndex: floorIndex)
|
|
204
199
|
}
|
|
205
200
|
|
|
206
201
|
func onShow() {
|
|
@@ -121,7 +121,7 @@ public class MapsIndoorsModule: NSObject {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
@objc public func getMapStyles(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
124
|
-
guard let mapControl = MapsIndoorsData.sharedInstance.
|
|
124
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapView?.getMapControl() else {
|
|
125
125
|
return doReject(reject, message: "getMapStyles: Must create MapControl first")
|
|
126
126
|
}
|
|
127
127
|
guard let venue = mapControl.currentVenue else {
|
package/ios/core/RCMapView.swift
CHANGED
|
@@ -11,4 +11,6 @@ protocol RCMapView {
|
|
|
11
11
|
func animateCamera(cameraUpdate: CameraUpdate, duration: Int) throws
|
|
12
12
|
func moveCamera(cameraUpdate: CameraUpdate) throws
|
|
13
13
|
func getConfig(config: NSDictionary) -> MPMapConfig
|
|
14
|
-
|
|
14
|
+
func getMapControl() -> MPMapControl?
|
|
15
|
+
func setMapControl(mapControl: MPMapControl)
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -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 "MapsIndoorsMapbox11", "4.5.
|
|
28
|
-
s.dependency "MapsIndoorsCodable", "4.5.
|
|
27
|
+
s.dependency "MapsIndoorsMapbox11", "4.5.11"
|
|
28
|
+
s.dependency "MapsIndoorsCodable", "4.5.11"
|
|
29
29
|
end
|
|
30
30
|
|
package/src/core/MPMapConfig.ts
CHANGED
|
@@ -116,6 +116,16 @@ export default class MPMapConfig {
|
|
|
116
116
|
*/
|
|
117
117
|
public readonly showMapMarkers?: boolean;
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Whether to show the road labels on the map.
|
|
121
|
+
* Mapbox specific
|
|
122
|
+
* The default value is undefined, and enables/disables based on the transition zoom level.
|
|
123
|
+
* @public
|
|
124
|
+
* @readonly
|
|
125
|
+
* @type {?boolean}
|
|
126
|
+
*/
|
|
127
|
+
public readonly showRoadLabels?: boolean;
|
|
128
|
+
|
|
119
129
|
/**
|
|
120
130
|
* Creates an instance of MPMapConfig.
|
|
121
131
|
*
|
|
@@ -136,6 +146,7 @@ export default class MPMapConfig {
|
|
|
136
146
|
this.floorSelector = params.floorSelector;
|
|
137
147
|
this.mapsIndoorsTransitionLevel = params.mapsIndoorsTransitionLevel;
|
|
138
148
|
this.showMapMarkers = params.showMapMarkers;
|
|
149
|
+
this.showRoadLabels = params.showRoadLabels;
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
152
|
|
|
@@ -244,4 +255,11 @@ export interface MPMapConfigParams {
|
|
|
244
255
|
* @type {?boolean}
|
|
245
256
|
*/
|
|
246
257
|
showMapMarkers?: boolean,
|
|
258
|
+
/**
|
|
259
|
+
* Whether to show the road labels on the map.
|
|
260
|
+
* Mapbox specific
|
|
261
|
+
* The default value is undefined, and enables/disables based on the transition zoom level.
|
|
262
|
+
* @type {boolean}
|
|
263
|
+
*/
|
|
264
|
+
showRoadLabels?: boolean,
|
|
247
265
|
}
|