bug fix: on() / addListener() execute only the first event listener
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta2-20170622-1302" 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-beta2-20170623-1207" 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
www/BaseClass.js
www/BaseClass.js
@@ -51,10 +51,11 @@ var BaseClass = function() {
if (!e.myself || e.myself !== self) {
return;
}
- var mydata = e.mydata;
- delete e.mydata;
- delete e.myself;
- self.event = e;
+ var evt = Object.create(e);
+ var mydata = evt.mydata;
+ delete evt.mydata;
+ delete evt.myself;
+ self.event = evt;
callback.apply(self, mydata);
};
document.addEventListener(eventName, listener, false);
@@ -109,10 +110,11 @@ var BaseClass = function() {
if (!e.myself || e.myself !== self) {
return;
}
- var mydata = e.mydata;
- delete e.mydata;
- delete e.myself;
- self.event = e;
+ var evt = Object.create(e);
+ var mydata = evt.mydata;
+ delete evt.mydata;
+ delete evt.myself;
+ self.event = evt;
callback.apply(self, mydata);
self.off(eventName, callback);
};

bug fix: on() / addListener() execute only the first event listener