Replace the string "promise-" from event name properly
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta3-20170808-1950" 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-20170808-2240" 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
@@ -64,7 +64,12 @@ BaseClass.prototype = {
},
trigger: function(eventName) {
- if (!eventName || !this[SUBSCRIPTIONS_FIELD][eventName]) {
+ if (!eventName) {
+ return this;
+ }
+
+ eventName = eventName.replace("promise-", "");
+ if (!this[SUBSCRIPTIONS_FIELD][eventName]) {
return this;
}
@@ -108,7 +113,11 @@ BaseClass.prototype = {
off: function(eventName, listener) {
if (!eventName && !listener) {
this[SUBSCRIPTIONS_FIELD] = {};
- } else if (eventName && !listener) {
+ return this;
+ }
+
+ eventName = eventName.replace("promise-", "");
+ if (eventName && !listener) {
this[SUBSCRIPTIONS_FIELD][eventName] = null;
} else if (this[SUBSCRIPTIONS_FIELD][eventName]) {
var index = this[SUBSCRIPTIONS_FIELD][eventName].indexOf(listener);

Replace the string "promise-" from event name properly