@rnmapbox/maps 10.1.32-rc.2 → 10.1.33-rc.0
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.
|
@@ -20,7 +20,7 @@ typealias ViewRefTag = Double
|
|
|
20
20
|
// see https://github.com/rnmapbox/maps/pull/3074
|
|
21
21
|
open class ViewTagResolver(val context: ReactApplicationContext) {
|
|
22
22
|
private val createdViews: HashSet<Int> = hashSetOf<Int>()
|
|
23
|
-
private val viewWaiters: HashMap<Int, MutableList<ViewTagWaiter<View
|
|
23
|
+
private val viewWaiters: HashMap<Int, MutableList<ViewTagWaiter<View?>>> = hashMapOf()
|
|
24
24
|
|
|
25
25
|
// to be called from view.setId
|
|
26
26
|
fun tagAssigned(viewTag: Int) {
|
|
@@ -68,7 +68,14 @@ open class ViewTagResolver(val context: ReactApplicationContext) {
|
|
|
68
68
|
}
|
|
69
69
|
} catch (err: IllegalViewOperationException) {
|
|
70
70
|
if (!createdViews.contains(viewTag)) {
|
|
71
|
-
viewWaiters.getOrPut(viewTag) { mutableListOf<ViewTagWaiter<View
|
|
71
|
+
viewWaiters.getOrPut(viewTag) { mutableListOf<ViewTagWaiter<View?>>() }.add(ViewTagWaiter<View?>({ view ->
|
|
72
|
+
if (view != null) {
|
|
73
|
+
fn(view as V)
|
|
74
|
+
} else {
|
|
75
|
+
Logger.e(LOG_TAG, "view: $viewTag but is null")
|
|
76
|
+
reject?.reject(Throwable("view: $viewTag but is null"))
|
|
77
|
+
}
|
|
78
|
+
}, reject))
|
|
72
79
|
} else {
|
|
73
80
|
reject?.reject(err)
|
|
74
81
|
}
|
|
@@ -111,8 +111,11 @@ extension RNMBXMapViewManager {
|
|
|
111
111
|
|
|
112
112
|
@objc public static func getVisibleBounds(
|
|
113
113
|
_ view: RNMBXMapView,
|
|
114
|
-
resolver: @escaping RCTPromiseResolveBlock
|
|
115
|
-
|
|
114
|
+
resolver: @escaping RCTPromiseResolveBlock,
|
|
115
|
+
rejecter: @escaping RCTPromiseRejectBlock) {
|
|
116
|
+
view.withMapboxMap { map in
|
|
117
|
+
resolver(["visibleBounds": map.coordinateBounds(for: view.bounds).toArray()])
|
|
118
|
+
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
}
|
|
@@ -87,7 +87,7 @@ RCT_EXPORT_METHOD(getPointInView:(nonnull NSNumber*)viewRef atCoordinate:(NSArra
|
|
|
87
87
|
|
|
88
88
|
RCT_EXPORT_METHOD(getVisibleBounds:(nonnull NSNumber*)viewRef resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
89
89
|
[self withMapView:viewRef block:^(RNMBXMapView *view) {
|
|
90
|
-
[RNMBXMapViewManager getVisibleBounds:view resolver:resolve];
|
|
90
|
+
[RNMBXMapViewManager getVisibleBounds:view resolver:resolve rejecter:reject];
|
|
91
91
|
} reject:reject methodName:@"getVisibleBounds"];
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -30,8 +30,8 @@ public class RNMBXRasterDemSource : RNMBXSource {
|
|
|
30
30
|
|
|
31
31
|
override func makeSource() -> Source
|
|
32
32
|
{
|
|
33
|
-
#if RNMBX_11
|
|
34
|
-
var result = SourceType(id:
|
|
33
|
+
#if RNMBX_11
|
|
34
|
+
var result = SourceType(id: self.id)
|
|
35
35
|
#else
|
|
36
36
|
var result = SourceType()
|
|
37
37
|
#endif
|