can't load local image for marker if wkwebview hosts the index.html on file:// protocol
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.11-beta-20180806-1918" 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.11-beta-20180808-1036" 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/PluginMarker.m
src/ios/GoogleMaps/PluginMarker.m
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(\\.\\/)+" options:NSRegularExpressionCaseInsensitive error:&error];
iconPath = [regex stringByReplacingMatchesInString:iconPath options:0 range:NSMakeRange(0, [iconPath length]) withTemplate:@"./"];
-
// Get the current URL, then calculate the relative path.
CDVViewController *cdvViewController = (CDVViewController*)self.viewController;
{
[self.mapCtrl.executeQueue addOperationWithBlock:^{
+ if ([url.absoluteString hasPrefix:@"file:"]) {
+ NSString *iconPath = [url.absoluteString stringByReplacingOccurrencesOfString:@"file:" withString:@""];
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+ if (![fileManager fileExistsAtPath:iconPath]) {
+ NSLog(@"(error)There is no file at '%@'.", iconPath);
+ completionBlock(NO, nil);
+ return;
+ } else {
+ UIImage *image = [UIImage imageNamed:iconPath];
+ completionBlock(YES, image);
+ }
+ }
+
NSURLRequest *req = [NSURLRequest requestWithURL:url
cachePolicy:NSURLRequestReturnCacheDataElseLoad
timeoutInterval:5];

can't load local image for marker if wkwebview hosts the index.html on file:// protocol #2376