(Probably) Bug fix: crash app when zooming or panning faster
MODIFY
src/ios/GoogleMaps/CordovaGoogleMaps.m
src/ios/GoogleMaps/CordovaGoogleMaps.m
}
[self.pluginMaps removeAllObjects];
+ @synchronized(self.pluginLayer.pluginScrollView.debugView.HTMLNodes) {
[self.pluginLayer.pluginScrollView.debugView.HTMLNodes removeAllObjects];
self.pluginLayer.pluginScrollView.debugView.HTMLNodes = nil;
+ }
[self.pluginLayer.pluginScrollView.debugView.mapCtrls removeAllObjects];
});

MODIFY
src/ios/GoogleMaps/MyPluginLayer.m
src/ios/GoogleMaps/MyPluginLayer.m
@@ -79,14 +79,12 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
- (void)putHTMLElements:(NSDictionary *)elementsDic {
[executeQueue addOperationWithBlock:^{
- if (stopFlag) {
- return;
- }
- stopFlag = YES;
-
CGRect rect = CGRectMake(0, 0, 0, 0);
NSMutableDictionary *domInfo, *size;
NSString *domId;
+
+ @synchronized(self.pluginScrollView.debugView.HTMLNodes) {
+
NSArray *keys=[self.pluginScrollView.debugView.HTMLNodes allKeys];
NSArray *keys2;
int i, j;
@@ -120,7 +118,7 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
}
self.pluginScrollView.debugView.HTMLNodes = newBuffer;
- stopFlag = NO;
+ }
}];
}
@@ -303,6 +301,7 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
continue;
}
domInfo =[self.pluginScrollView.debugView.HTMLNodes objectForKey:mapCtrl.mapDivId];
+
rect = CGRectFromString([domInfo objectForKey:@"size"]);
rect.origin.x += offsetX2;
rect.origin.y += offsetY2;
@@ -337,8 +336,8 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
// Is the clicked point is on the html elements in the map?
mapDivInfo = [self.pluginScrollView.debugView.HTMLNodes objectForKey:mapCtrl.mapDivId];
- mapDivDepth = [[mapDivInfo objectForKey:@"depth"] intValue];
+ mapDivDepth = [[mapDivInfo objectForKey:@"depth"] intValue];
for (NSString *domId in self.pluginScrollView.debugView.HTMLNodes) {
if ([mapCtrl.mapDivId isEqualToString:domId]) {
continue;
@@ -367,7 +366,6 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
//NSLog(@"--> hit (%@) : (domId: %@, depth: %d) ", mapCtrl.mapId, domId, domDepth);
break;
}
-
}
if (isMapAction == NO) {

(Probably) Bug fix: crash app when zooming or panning faster

https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1407
https://github.com/mapsplugin/v2.0-demo/issues/23