Cause
cordova-android 10+ switched to use WebAssetLoader, and the default scheme is https
The AsyncLoadImage file did not check for https scheme for localhost
Current behavior:
The default Google Map red marker is shown
Expected behavior:
The custom image is used for the Marker
Fix
The gist is to change line 199 to this.
if (iconUrl.startsWith("http://localhost") ||
iconUrl.startsWith("https://localhost") ||
iconUrl.startsWith("http://127.0.0.1") ||
iconUrl.startsWith("https://127.0.0.1")
) {
// Log.d(TAG, String.format("---->(201)iconURL = %s", iconUrl));
if (iconUrl.contains("://")) {
iconUrl = iconUrl.replaceAll("https?://.+?/", "file:///android_asset/www/");
} else {
// Avoid WebViewLocalServer (because can not make a connection for some reason)
iconUrl = "file:///android_asset/www/".concat(iconUrl);
}
}
Screen capture or video record:
Related code, data or error log (please format your code or data):
Please share your project files on Github or others(Bitbucket, Gitlabs...etc).
If you don't want to share your project files, please create a demo project, then share it.
Screen captures, and/or native logs(such as Logcat, xcode logs) are appreciate.
Giving much information, you are waiting time is less.
Thank you for your cooperation.
Support this plugin activity
I appreicate if you give me a beer :beer: from here
I'm submitting a ... (check one with "x")
OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)If you use
@ionic-native/google-maps
, please tell the package.json (only@ionic-native/core
and@ionic-native/google-maps
are fine mostly)Cause cordova-android 10+ switched to use
WebAssetLoader
, and the default scheme ishttps
TheAsyncLoadImage
file did not check forhttps
scheme for localhostMore info here: https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html https://github.com/apache/cordova-android/issues/1316
Current behavior: The default Google Map red marker is shown
Expected behavior: The custom image is used for the Marker
Fix The gist is to change line 199 to this.
Screen capture or video record:
Related code, data or error log (please format your code or data):
Support this plugin activity
I appreicate if you give me a beer :beer: from here