Fix two js error when change very quickly between two pages with map
MODIFY
www/Map.js
www/Map.js
@@ -1276,12 +1276,14 @@ Map.prototype.addPolyline = function(polylineOptions, callback) {
});
self.exec.call(self, function() {
+ if (polyline) {
polyline._privateInitialize();
delete polyline._privateInitialize;
if (typeof callback === 'function') {
callback.call(self, polyline);
}
+ }
}, self.errorHandler, self.__pgmId, 'loadPlugin', ['Polyline', opts, polyline.hashCode]);
return polyline;
@@ -1374,7 +1376,7 @@ Map.prototype.addMarker = function(markerOptions, callback) {
}
self.exec.call(self, function(result) {
-
+ if (marker) {
markerOptions.icon.size = markerOptions.icon.size || {};
markerOptions.icon.size.width = markerOptions.icon.size.width || result.width;
markerOptions.icon.size.height = markerOptions.icon.size.height || result.height;
@@ -1389,6 +1391,7 @@ Map.prototype.addMarker = function(markerOptions, callback) {
if (typeof callback === 'function') {
callback.call(self, marker);
}
+ }
}, self.errorHandler, self.__pgmId, 'loadPlugin', ['Marker', markerOptions, marker.hashCode]);
return marker;

Fix two js error when change very quickly between two pages with map