@maplibre/maplibre-react-native 11.3.4 → 11.3.5
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.
|
@@ -49,6 +49,10 @@ typedef NS_ENUM(NSInteger, MLRNImageQueueOperationState) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
- (BOOL)isAsynchronous {
|
|
53
|
+
return YES;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
- (void)setCancellationBlock:(dispatch_block_t)block {
|
|
53
57
|
_cancellationBlock = block;
|
|
54
58
|
}
|
|
@@ -100,12 +104,22 @@ typedef NS_ENUM(NSInteger, MLRNImageQueueOperationState) {
|
|
|
100
104
|
if (self.state == IOState_CancelledDoNotExecute) {
|
|
101
105
|
return;
|
|
102
106
|
}
|
|
103
|
-
|
|
107
|
+
|
|
108
|
+
MLRNImageQueueOperationState prevState = [self setState:IOState_Executing only:IOState_Initial];
|
|
109
|
+
if (prevState != IOState_Initial) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
MLRNImageQueueOperation *strongSelf = self;
|
|
104
114
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
if (strongSelf.isCancelled) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[strongSelf
|
|
120
|
+
setCancellationBlock:[strongSelf.imageLoader loadImageWithURLRequest:strongSelf.urlRequest
|
|
107
121
|
size:CGSizeZero
|
|
108
|
-
scale:
|
|
122
|
+
scale:strongSelf.scale
|
|
109
123
|
clipped:YES
|
|
110
124
|
resizeMode:RCTResizeModeStretch
|
|
111
125
|
progressBlock:^(int64_t progress, int64_t total) {
|
|
@@ -115,16 +129,17 @@ typedef NS_ENUM(NSInteger, MLRNImageQueueOperationState) {
|
|
|
115
129
|
// No-op
|
|
116
130
|
}
|
|
117
131
|
completionBlock:^void(NSError *error, UIImage *image) {
|
|
118
|
-
if (image &&
|
|
132
|
+
if (image && strongSelf.sdf) {
|
|
119
133
|
image = [image
|
|
120
134
|
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
|
121
135
|
}
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
if (strongSelf.completionHandler) {
|
|
137
|
+
strongSelf.completionHandler(error, image);
|
|
138
|
+
}
|
|
139
|
+
[strongSelf setState:IOState_Finished only:IOState_Executing];
|
|
124
140
|
}]];
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
[weakSelf callCancellationBlock];
|
|
141
|
+
if (strongSelf.isCancelled) {
|
|
142
|
+
[strongSelf callCancellationBlock];
|
|
128
143
|
}
|
|
129
144
|
});
|
|
130
145
|
}
|
package/package.json
CHANGED