Skip to content

Commit

Permalink
fix: Custom markers not working for cordova-android 10+ and add check…
Browse files Browse the repository at this point in the history
…ed for https scheme

Original credits goes to @ebhsgit (mapsplugin/cordova-plugin-googlemaps@514426a)
  • Loading branch information
ebhsgit authored and mcastets committed Dec 22, 2021
1 parent afc72f5 commit 66f183a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/android/plugin/google/maps/AsyncLoadImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ protected AsyncLoadImageResult doInBackground(Void... params) {
if (!iconUrl.startsWith("data:image")) {

if (iconUrl.startsWith("http://localhost") ||
iconUrl.startsWith("http://127.0.0.1")) {
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("http://.+?/", "file:///android_asset/www/");
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);
Expand Down

0 comments on commit 66f183a

Please sign in to comment.