Skip to content

Commit 2968848

Browse files
committed
Squashed commit of the following:
commit 4e7b436 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 c7e60a0 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
1 parent 4aa005d commit 2968848

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

src/android/plugin/google/maps/CordovaGoogleMaps.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,13 @@ public void getMap(final JSONArray args, final CallbackContext callbackContext)
448448
//------------------------------------------
449449
JSONObject meta = args.getJSONObject(0);
450450
String mapId = meta.getString("__pgmId");
451-
PluginMap pluginMap = new PluginMap();
452-
pluginMap.privateInitialize(mapId, cordova, webView, null);
453-
pluginMap.initialize(cordova, webView);
454-
pluginMap.mapCtrl = CordovaGoogleMaps.this;
455-
pluginMap.self = pluginMap;
456451

452+
PluginMap pluginMap = new PluginMap();
457453
PluginEntry pluginEntry = new PluginEntry(mapId, pluginMap);
458454
pluginManager.addService(pluginEntry);
459455

456+
pluginMap.mapCtrl = CordovaGoogleMaps.this;
457+
pluginMap.self = pluginMap;
460458
pluginMap.getMap(args, callbackContext);
461459
}
462460

@@ -470,14 +468,12 @@ public void getPanorama(final JSONArray args, final CallbackContext callbackCont
470468
String mapId = meta.getString("__pgmId");
471469
Log.d(TAG, "---> mapId = " + mapId);
472470
PluginStreetViewPanorama pluginStreetView = new PluginStreetViewPanorama();
473-
pluginStreetView.privateInitialize(mapId, cordova, webView, null);
474-
pluginStreetView.initialize(cordova, webView);
475-
pluginStreetView.mapCtrl = CordovaGoogleMaps.this;
476-
pluginStreetView.self = pluginStreetView;
477-
478471
PluginEntry pluginEntry = new PluginEntry(mapId, pluginStreetView);
479472
pluginManager.addService(pluginEntry);
480473

474+
pluginStreetView.mapCtrl = CordovaGoogleMaps.this;
475+
pluginStreetView.self = pluginStreetView;
476+
481477
pluginStreetView.getPanorama(args, callbackContext);
482478
}
483479

src/android/plugin/google/maps/PluginMap.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,6 @@ public synchronized void loadPlugin(final JSONArray args, final CallbackContext
613613
plugins.put(pluginName, pluginEntry);
614614
mapCtrl.pluginManager.addService(pluginEntry);
615615

616-
plugin.privateInitialize(pluginName, cordova, webView, null);
617-
618-
plugin.initialize(cordova, webView);
619616
((MyPluginInterface)plugin).setPluginMap(PluginMap.this);
620617
MyPlugin myPlugin = (MyPlugin) plugin;
621618
myPlugin.self = (MyPlugin)plugin;
@@ -666,8 +663,6 @@ public void create(final JSONArray args, final CallbackContext callbackContext)
666663
pluginMap = PluginMap.this;
667664
pluginMap.mapCtrl.pluginManager.addService(pluginEntry);
668665

669-
plugin.privateInitialize(className, cordova, webView, null);
670-
plugin.initialize(cordova, webView);
671666
((MyPluginInterface)plugin).setPluginMap(PluginMap.this);
672667
pluginEntry.plugin.execute("create", args, callbackContext);
673668

src/browser/PluginMarker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess, o
150150
});
151151
};
152152
img.onerror = function(error) {
153-
console.warn(error.getMessage());
153+
console.warn('[PluginMarker] Could not load img', error);
154154
onSuccess(marker, {
155155
'__pgmId': markerId,
156156
'width': 20,

src/browser/PluginMarkerCluster.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ PluginMarkerCluster.prototype.redrawClusters = function(onSuccess, onError, args
353353
}
354354
self.pluginMarkers[clusterId_markerId] = STATUS.DELETED;
355355

356-
console.warn(error.getMessage());
356+
console.warn('[PluginMarkerCluster] Could not read icon', error);
357357
self.deleteMarkers.push(clusterId_markerId);
358358
resolve();
359359
});

0 commit comments

Comments
 (0)