Update: remove FakeObservable() class
Bug fix: common.createMvcArray()
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.0-beta3-20170825-2216" 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-20170826-0040" 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
var VARS_FIELD = typeof Symbol === 'undefined' ? '__vars' + Date.now() : Symbol.for('vars');
var SUBSCRIPTIONS_FIELD = typeof Symbol === 'undefined' ? '__subs' + Date.now() : Symbol.for('subscriptions');
-function FakeObservable() {
- this.next = undefined;
- this.error = undefined;
- this.complete = undefined;
- this.done = false;
- this.values = undefined;
-}
-FakeObservable.prototype.subscribe = function(next, error, complete) {
- this.next = next;
- this.error = error;
- this.complete = complete;
- if (this.done && typeof next === "function") {
- next(this.values);
- }
-};
-
-FakeObservable.prototype.keepValues = function(values) {
- this.values = values;
- this.done = true;
-};
function BaseClass() {
this[VARS_FIELD] = {};
@@ -68,7 +48,6 @@ BaseClass.prototype = {
return this;
}
- eventName = eventName.replace("promise-", "");
if (!this[SUBSCRIPTIONS_FIELD][eventName]) {
return this;
}
@@ -86,28 +65,10 @@ BaseClass.prototype = {
on: function(eventName, listener) {
var topic;
- if (listener && eventName.indexOf('promise-') === -1) {
this[SUBSCRIPTIONS_FIELD][eventName] = this[SUBSCRIPTIONS_FIELD][eventName] || [];
topic = this[SUBSCRIPTIONS_FIELD][eventName];
topic.push(listener);
return this;
- }
-
- eventName = eventName.replace("promise-", "");
- this[SUBSCRIPTIONS_FIELD][eventName] = this[SUBSCRIPTIONS_FIELD][eventName] || [];
- topic = this[SUBSCRIPTIONS_FIELD][eventName];
-
- var self = this;
- var fakeObservable = new FakeObservable();
- topic.push(function() {
- var args = Array.prototype.slice.call(arguments, 0);
- if (typeof fakeObservable.next === 'function') {
- fakeObservable.next.apply(self, args);
- } else {
- fakeObservable.keepValues(args);
- }
- });
- return fakeObservable;
},
off: function(eventName, listener) {
@@ -116,7 +77,6 @@ BaseClass.prototype = {
return this;
}
- eventName = eventName.replace("promise-", "");
if (eventName && !listener) {
this[SUBSCRIPTIONS_FIELD][eventName] = null;
} else if (this[SUBSCRIPTIONS_FIELD][eventName]) {
@@ -134,20 +94,6 @@ BaseClass.prototype = {
var self = this;
- if (!listener || eventName.indexOf("promise-") === 0) {
- eventName = eventName.replace("promise-", "");
- return new window.Promise(function(resolve, reject) {
- var callback = function() {
- self.off(eventName, arguments.callee);
-
- var args = Array.prototype.slice.call(arguments, 0);
- resolve.apply(self, [args]);
- };
- self.on(eventName, callback);
-
- });
- }
-
var callback = function() {
self.off(eventName, arguments.callee);
listener.apply(self, arguments);

MODIFY
www/Common.js
www/Common.js
@@ -497,6 +497,9 @@ function defaultTrueOption(value) {
}
function createMvcArray(array) {
+ if (!array) {
+ return new BaseArrayClass();
+ }
if (array.type === "BaseArrayClass") {
return array;
}

Update: remove FakeObservable() class

Bug fix: common.createMvcArray()