You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] Custom marker not showing when using Cordova-android 10+ #2886
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.
Activity
ebhsgit commentedon Oct 23, 2021
Issue also mentioned in #2871
FIX - mapsplugin#2886 - Custom markers not working for cordova-androi…
Merge pull request #2 from Skandnet/pr-fix_2886
SoftwareAndOutsourcing commentedon Feb 3, 2022
The solution above seems to solve the issue but customs markers will still not show if you use the Cordova local development server.
FIX - mapsplugin#2886 - Custom markers not working for cordova-androi…
Merge pull request #2 from ebhsgit/pr-fix_2886
FIX - mapsplugin#2886 - Custom marker not showing when using Cordova-…