Fix: the Google Maps JS API v3 warns "this site add Object.prototype.assign"
MODIFY
www/Common.js
www/Common.js
@@ -712,6 +712,20 @@ function hashCode(text) {
return hash;
}
+function assign() {
+ var args = [].slice.call(arguments),
+ target = args.shift();
+
+ return args.reduce(function(base, obj) {
+ Object.keys(obj).forEach(function(prop) {
+ if (obj.hasOwnProperty(prop)) {
+ base[prop] = obj[prop];
+ }
+ });
+ return base;
+ }, target);
+}
+
module.exports = {
_clearInternalCache: _clearInternalCache,
_removeCacheById: _removeCacheById,
@@ -734,7 +748,8 @@ module.exports = {
quickfilter: quickfilter,
nextTick: nextTick,
getPluginDomId: getPluginDomId,
- hashCode: hashCode
+ hashCode: hashCode,
+ assign: assign
};
if (cordova && cordova.platformId === "browser") {

MODIFY
www/StreetViewPanorama.js
www/StreetViewPanorama.js
@@ -259,7 +259,7 @@ StreetViewPanorama.prototype.remove = function(callback) {
};
StreetViewPanorama.prototype._onPanoramaCameraChange = function(eventName, cameraPosition) {
var self = this;
- self.set('camera', Object.assign(self.get("camera") || {}, cameraPosition));
+ self.set('camera', common.assign(self.get("camera") || {}, cameraPosition));
self.set('camera_zoom', cameraPosition.zoom);
self.set('camera_bearing', cameraPosition.bearing);
self.set('camera_tilt', cameraPosition.viewAngle || cameraPosition.tilt);

MODIFY
www/pluginInit.js
www/pluginInit.js
@@ -43,24 +43,6 @@ function pluginInit() {
};
})();
}
- if (typeof Object.prototype.assign !== "function") {
- (function() {
- Object.prototype.assign = function() {
- var args = [].slice.call(arguments),
- target = args.shift();
-
- return args.reduce(function(base, obj) {
- Object.keys(obj).forEach(function(prop) {
- if (obj.hasOwnProperty(prop)) {
- base[prop] = obj[prop];
- }
- });
- return base;
- }, target);
- };
- })();
- }
-
/*****************************************************************************
* To prevent strange things happen,
* disable the changing of viewport zoom level by double clicking.

Fix: the Google Maps JS API v3 warns "this site add Object.prototype.assign"