Bug fix: MAP_READY event not fired on IOS
MODIFY
src/ios/GoogleMaps/PluginMap.m
src/ios/GoogleMaps/PluginMap.m
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- // Trigger the map_loaded event if current mapType == kMapTypeNone && request method is `getMap()`
- if (self.mapCtrl.map.mapType == kGMSTypeNone) {
+ // Trigger the map_loaded event if request method is `getMap()`
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self.mapCtrl mapViewDidFinishTileRendering:self.mapCtrl.map];
});
- }
return;
}
NSDictionary *cameraOpts = [initOptions objectForKey:@"camera"];
[self _changeCameraPosition:@"moveCamera" requestMethod:requestMethod params:cameraOpts command:command];
} else {
+ [self.mapCtrl.view setHidden:NO];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- // Trigger the map_loaded event if current mapType == kMapTypeNone && request method is `getMap()`
- if (self.mapCtrl.map.mapType == kGMSTypeNone &&
- [[initOptions objectForKey:@"method"] isEqualToString:@"getMap"]) {
+ // Trigger the map_loaded event if request method is `getMap()`
+ if ([requestMethod isEqualToString:@"getMap"]) {
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self.mapCtrl mapViewDidFinishTileRendering:self.mapCtrl.map];

Bug fix: MAP_READY event not fired on IOS (#1594)