Bug fix: setMyLocationEnabled crash map
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.1.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.1.1-beta-20171101-1736" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/android/plugin/google/maps/MyPlugin.java
src/android/plugin/google/maps/MyPlugin.java
@@ -73,9 +73,10 @@ public class MyPlugin extends CordovaPlugin implements MyPluginInterface {
return;
}
+ synchronized (methods) {
if (methods.size() == 0) {
TAG = MyPlugin.this.getServiceName();
- //Log.d("MyPlugin", "TAG = " + TAG);
+ Log.d("MyPlugin", "TAG = " + TAG);
if (!TAG.contains("-")) {
mapCtrl.mPluginLayout.pluginMaps.put(TAG, (PluginMap) MyPlugin.this);
} else {
@@ -91,10 +92,14 @@ public class MyPlugin extends CordovaPlugin implements MyPluginInterface {
Method[] classMethods = self.getClass().getMethods();
for (Method classMethod : classMethods) {
methods.put(classMethod.getName(), classMethod);
+ Log.d("MyPlugin", "---> plugin = " + classMethod.getName() + ", " + classMethod);
}
}
+
+
// this.create(args, callbackContext);
// return true;
+ Log.d(TAG, "(debug)action=" + action + " containsKey=" + methods.containsKey(action));
if (methods.containsKey(action)) {
if (self.mapCtrl.mPluginLayout.isDebug) {
try {
@@ -123,11 +128,13 @@ public class MyPlugin extends CordovaPlugin implements MyPluginInterface {
}
}
}
+ }
});
return true;
}
+
protected void create(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
// dummy
}

Bug fix: setMyLocationEnabled crash map #1848