Update: prevent "THREAD WARNING: ['CordovaGoogleMaps'] took '17.313965' ms. Plugin should use a background thread." error
MODIFY
src/ios/GoogleMaps/CordovaGoogleMaps.m
src/ios/GoogleMaps/CordovaGoogleMaps.m
self.webView.opaque = NO;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:nil];
#endif
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
self.executeQueue = [NSOperationQueue new];
+ self.executeQueue.maxConcurrentOperationCount = 10;
+ });
+
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
//-------------------------------
// Check the Google Maps API key
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
- (void)updateMapPositionOnly:(CDVInvokedUrlCommand *)command {
+ [self.executeQueue addOperationWithBlock:^{
if (self.pluginLayer != nil) {
NSDictionary *elementsDic = [command.arguments objectAtIndex:0];
self.pluginLayer.pauseResize = false;
self.pluginLayer.isSuspended = false;
self.pluginLayer.isSuspended = false;
+ [[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self.pluginLayer resizeTask:nil];
+ }];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
}
- (void)resumeResizeTimer:(CDVInvokedUrlCommand *)command {

Update: prevent "THREAD WARNING: ['CordovaGoogleMaps'] took '17.313965' ms. Plugin should use a background thread." error #1756