Do not sort resolutions array

We assert that the resolutions array is sorted instead of sorting it ourselves. This is to consistent with ol.TileGrid.
This commit is contained in:
Éric Lemoine
2013-02-15 17:52:06 +01:00
parent e1505abe0d
commit 1e4229497d
+5 -3
View File
@@ -61,9 +61,11 @@ ol.source.ImageSource = function(options) {
*/ */
this.resolutions_ = goog.isDef(options.resolutions) ? this.resolutions_ = goog.isDef(options.resolutions) ?
options.resolutions : null; options.resolutions : null;
if (!goog.isNull(this.resolutions_)) { goog.asserts.assert(goog.isNull(this.resolutions_) ||
goog.array.sort(this.resolutions_, function(a, b) {return b - a; }); goog.array.isSorted(this.resolutions_,
} function(a, b) {
return b - a;
}, true));
}; };
goog.inherits(ol.source.ImageSource, ol.source.Source); goog.inherits(ol.source.ImageSource, ol.source.Source);