diff --git a/src/android/plugin/google/maps/AsyncLoadImage.java b/src/android/plugin/google/maps/AsyncLoadImage.java index 16e0bb0..79faead 100644 --- a/src/android/plugin/google/maps/AsyncLoadImage.java +++ b/src/android/plugin/google/maps/AsyncLoadImage.java @@ -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); diff --git a/src/android/plugin/google/maps/CordovaGoogleMaps.java b/src/android/plugin/google/maps/CordovaGoogleMaps.java index 7e965dc..6239f26 100644 --- a/src/android/plugin/google/maps/CordovaGoogleMaps.java +++ b/src/android/plugin/google/maps/CordovaGoogleMaps.java @@ -448,15 +448,13 @@ public void getMap(final JSONArray args, final CallbackContext callbackContext) //------------------------------------------ JSONObject meta = args.getJSONObject(0); String mapId = meta.getString("__pgmId"); - PluginMap pluginMap = new PluginMap(); - pluginMap.privateInitialize(mapId, cordova, webView, null); - pluginMap.initialize(cordova, webView); - pluginMap.mapCtrl = CordovaGoogleMaps.this; - pluginMap.self = pluginMap; + PluginMap pluginMap = new PluginMap(); PluginEntry pluginEntry = new PluginEntry(mapId, pluginMap); pluginManager.addService(pluginEntry); + pluginMap.mapCtrl = CordovaGoogleMaps.this; + pluginMap.self = pluginMap; pluginMap.getMap(args, callbackContext); } @@ -470,14 +468,12 @@ public void getPanorama(final JSONArray args, final CallbackContext callbackCont String mapId = meta.getString("__pgmId"); Log.d(TAG, "---> mapId = " + mapId); PluginStreetViewPanorama pluginStreetView = new PluginStreetViewPanorama(); - pluginStreetView.privateInitialize(mapId, cordova, webView, null); - pluginStreetView.initialize(cordova, webView); - pluginStreetView.mapCtrl = CordovaGoogleMaps.this; - pluginStreetView.self = pluginStreetView; - PluginEntry pluginEntry = new PluginEntry(mapId, pluginStreetView); pluginManager.addService(pluginEntry); + pluginStreetView.mapCtrl = CordovaGoogleMaps.this; + pluginStreetView.self = pluginStreetView; + pluginStreetView.getPanorama(args, callbackContext); } diff --git a/src/android/plugin/google/maps/PluginMap.java b/src/android/plugin/google/maps/PluginMap.java index a3d379f..96d4fbb 100644 --- a/src/android/plugin/google/maps/PluginMap.java +++ b/src/android/plugin/google/maps/PluginMap.java @@ -613,9 +613,6 @@ public synchronized void loadPlugin(final JSONArray args, final CallbackContext plugins.put(pluginName, pluginEntry); mapCtrl.pluginManager.addService(pluginEntry); - plugin.privateInitialize(pluginName, cordova, webView, null); - - plugin.initialize(cordova, webView); ((MyPluginInterface)plugin).setPluginMap(PluginMap.this); MyPlugin myPlugin = (MyPlugin) plugin; myPlugin.self = (MyPlugin)plugin; @@ -666,8 +663,6 @@ public void create(final JSONArray args, final CallbackContext callbackContext) pluginMap = PluginMap.this; pluginMap.mapCtrl.pluginManager.addService(pluginEntry); - plugin.privateInitialize(className, cordova, webView, null); - plugin.initialize(cordova, webView); ((MyPluginInterface)plugin).setPluginMap(PluginMap.this); pluginEntry.plugin.execute("create", args, callbackContext); diff --git a/src/browser/PluginMarker.js b/src/browser/PluginMarker.js index cc7d3d6..20dc972 100644 --- a/src/browser/PluginMarker.js +++ b/src/browser/PluginMarker.js @@ -150,7 +150,7 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess, o }); }; img.onerror = function(error) { - console.warn(error.getMessage()); + console.warn('[PluginMarker] Could not load img', error); onSuccess(marker, { '__pgmId': markerId, 'width': 20, diff --git a/src/browser/PluginMarkerCluster.js b/src/browser/PluginMarkerCluster.js index 68b304a..a608f80 100644 --- a/src/browser/PluginMarkerCluster.js +++ b/src/browser/PluginMarkerCluster.js @@ -353,7 +353,7 @@ PluginMarkerCluster.prototype.redrawClusters = function(onSuccess, onError, args } self.pluginMarkers[clusterId_markerId] = STATUS.DELETED; - console.warn(error.getMessage()); + console.warn('[PluginMarkerCluster] Could not read icon', error); self.deleteMarkers.push(clusterId_markerId); resolve(); });