@rnmapbox/maps 10.0.13 → 10.0.14
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/android/build.gradle
CHANGED
|
@@ -63,9 +63,12 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
63
63
|
return
|
|
64
64
|
}
|
|
65
65
|
mAboveLayerID = aboveLayerID
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (aboveLayerID == null) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
mMapView?.let {mapView ->
|
|
70
|
+
removeFromMap(mapView, RemovalReason.REORDER)
|
|
71
|
+
addAbove(mapView, aboveLayerID)
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -74,9 +77,12 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
74
77
|
return
|
|
75
78
|
}
|
|
76
79
|
mBelowLayerID = belowLayerID
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
if (belowLayerID == null) {
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
mMapView?.let { mapView ->
|
|
84
|
+
removeFromMap(mapView,RemovalReason.REORDER)
|
|
85
|
+
addBelow(mapView, belowLayerID)
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
|
|
@@ -159,28 +165,36 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
|
|
162
|
-
fun addAbove(aboveLayerID: String
|
|
163
|
-
|
|
164
|
-
override fun found(
|
|
168
|
+
fun addAbove(mapView: RCTMGLMapView, aboveLayerID: String) {
|
|
169
|
+
mapView.waitForLayer(aboveLayerID, object : FoundLayerCallback {
|
|
170
|
+
override fun found(aboveLayer: Layer?) {
|
|
165
171
|
if (!hasInitialized()) {
|
|
166
172
|
return
|
|
167
173
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
mapView.savedStyle?.let { style ->
|
|
175
|
+
mLayer?.let {layer ->
|
|
176
|
+
style.addLayerAbove(layer, aboveLayerID)
|
|
177
|
+
mapView.layerAdded(layer)
|
|
178
|
+
mMapView = mapView
|
|
179
|
+
}
|
|
180
|
+
}
|
|
171
181
|
}
|
|
172
182
|
})
|
|
173
183
|
}
|
|
174
184
|
|
|
175
|
-
fun addBelow(belowLayerID: String
|
|
176
|
-
|
|
177
|
-
override fun found(
|
|
185
|
+
fun addBelow(mapView: RCTMGLMapView, belowLayerID: String) {
|
|
186
|
+
mapView.waitForLayer(belowLayerID, object : FoundLayerCallback {
|
|
187
|
+
override fun found(belowLayer: Layer?) {
|
|
178
188
|
if (!hasInitialized()) {
|
|
179
189
|
return
|
|
180
190
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
191
|
+
mapView.savedStyle?.let { style ->
|
|
192
|
+
mLayer?.let { layer ->
|
|
193
|
+
style.addLayerBelow(layer, belowLayerID)
|
|
194
|
+
mapView.layerAdded(layer)
|
|
195
|
+
mMapView = mapView
|
|
196
|
+
}
|
|
197
|
+
}
|
|
184
198
|
}
|
|
185
199
|
})
|
|
186
200
|
}
|
|
@@ -211,16 +225,20 @@ abstract class RCTLayer<T : Layer?>(protected var mContext: Context) : AbstractS
|
|
|
211
225
|
if (style.styleLayerExists(id)) {
|
|
212
226
|
return // prevent adding a layer twice
|
|
213
227
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
mMapView?.let { mapView ->
|
|
229
|
+
mLayer?.let { layer ->
|
|
230
|
+
mAboveLayerID?.also {
|
|
231
|
+
addAbove(mapView, it)
|
|
232
|
+
} ?: { mBelowLayerID?.also {
|
|
233
|
+
addBelow(mapView, it)
|
|
234
|
+
} ?: { mLayerIndex?.also {
|
|
235
|
+
addAtIndex(it)
|
|
236
|
+
} ?: {
|
|
237
|
+
add ()
|
|
238
|
+
} } }
|
|
239
|
+
}
|
|
240
|
+
setZoomBounds()
|
|
222
241
|
}
|
|
223
|
-
setZoomBounds()
|
|
224
242
|
}
|
|
225
243
|
|
|
226
244
|
protected fun setZoomBounds() {
|