Fix: addTileOverlay() does not accept `file://` protocol on iOS
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.0-rc1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.3.0-beta-20180430-1711" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/ios/GoogleMaps/PluginTileProvider.m
src/ios/GoogleMaps/PluginTileProvider.m
@@ -98,9 +98,10 @@ NSDictionary *debugAttributes;
@synchronized (self.tileUrlMap) {
urlStr = [self.tileUrlMap objectForKey:urlKey];
[self.tileUrlMap removeObjectForKey:urlKey];
- } NSString *originalUrlStr = urlStr;
+ }
+ NSString *originalUrlStr = urlStr;
- if (urlStr == nil || [urlStr isEqualToString:@"(null)"]) {
+ if (urlStr == nil || [urlStr containsString:@"(null)"]) {
//-------------------------
// No image tile
//-------------------------
@@ -114,6 +115,7 @@ NSDictionary *debugAttributes;
} else {
[receiver receiveTileWithX:x y:y zoom:zoom image:kGMSTileLayerNoTile];
}
+ return;
}
NSRange range = [urlStr rangeOfString:@"http"];
@@ -124,6 +126,7 @@ NSDictionary *debugAttributes;
[self downloadImageWithX:x y:y zoom:zoom url:[NSURL URLWithString:urlStr] receiver:receiver];
return;
}
+ urlStr = [urlStr stringByReplacingOccurrencesOfString:@"file://" withString:@""];
range = [urlStr rangeOfString:@"://"];
if (range.location == NSNotFound) {

Fix: addTileOverlay() does not accept `file://` protocol on iOS