Skip to content

Commit

Permalink
v2.7.1.3
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 66f183a
Author: 8bhsolutions <[email protected]>
Date:   Sat Oct 23 14:25:12 2021 +1100

    fix: Custom markers not working for cordova-android 10+ and add checked for https scheme

    Original credits goes to @ebhsgit (mapsplugin/cordova-plugin-googlemaps@514426a)

commit afc72f5
Author: 8bhsolutions <[email protected]>
Date:   Fri May 21 17:33:55 2021 +1000

    fix: Blank map when starting app using cordova-android branch which has upgraded AGP to 4.1.3

    Original credits goes to @ebhsgit (mapsplugin/cordova-plugin-googlemaps#2871)

commit 230040f
Author: Mathieu Castets <[email protected]>
Date:   Tue Dec 21 18:40:40 2021 +0100

    fix: Remove JS calls to getMessage() as this method does not exist on error object
  • Loading branch information
mcastets committed Dec 22, 2021
1 parent 4aa005d commit 5fee587
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 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
16 changes: 6 additions & 10 deletions src/android/plugin/google/maps/CordovaGoogleMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
5 changes: 0 additions & 5 deletions src/android/plugin/google/maps/PluginMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/browser/PluginMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/browser/PluginMarkerCluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 5fee587

Please sign in to comment.