Bug fix: map does not response when you coming back from another activity
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta3-20170824-1438" 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.0.0-beta3-20170824-1551" 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/CordovaGoogleMaps.java
src/android/plugin/google/maps/CordovaGoogleMaps.java
@@ -97,6 +97,7 @@ public class CordovaGoogleMaps extends CordovaPlugin implements ViewTreeObserver
cordova.getActivity().runOnUiThread(new Runnable() {
@SuppressLint("NewApi")
public void run() {
+ CURRENT_URL = webView.getUrl();
// Enable this, webView makes draw cache on the Android action bar issue.
//View view = webView.getView();
@@ -245,12 +246,14 @@ public class CordovaGoogleMaps extends CordovaPlugin implements ViewTreeObserver
@Override
public boolean onOverrideUrlLoading(String url) {
mPluginLayout.isSuspended = true;
+ /*
this.activity.runOnUiThread(new Runnable() {
@Override
public void run() {
webView.loadUrl("javascript:if(window.cordova){cordova.fireDocumentEvent('plugin_url_changed', {});}");
}
});
+ */
CURRENT_URL = url;
return false;
}
@@ -878,6 +881,18 @@ public class CordovaGoogleMaps extends CordovaPlugin implements ViewTreeObserver
@Override
public void onResume(boolean multitasking) {
super.onResume(multitasking);
+ if (mPluginLayout != null) {
+ mPluginLayout.isSuspended = false;
+
+ if (mPluginLayout.pluginMaps.size() > 0) {
+ this.activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ webView.loadUrl("javascript:if(window.cordova){cordova.fireDocumentEvent('plugin_touch', {});}");
+ }
+ });
+ }
+ }
cordova.getThreadPool().submit(new Runnable() {
@Override

Bug fix: map does not response when you coming back from another activity