mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
removed initialize anti-pattern from dzitilesource constructor.
This commit is contained in:
parent
a7050af619
commit
c7706ba66c
@ -2592,16 +2592,8 @@ $.DziTileSource = function(width, height, tileSize, tileOverlap, tilesUrl, fileF
|
||||
|
||||
this.fileFormat = fileFormat;
|
||||
this.displayRects = displayRects;
|
||||
this.initialize();
|
||||
};
|
||||
|
||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
|
||||
initialize: function() {
|
||||
if (!this.displayRects) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( this.displayRects ) {
|
||||
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
||||
var rect = this.displayRects[i];
|
||||
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
||||
@ -2611,7 +2603,11 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
this._levelRects[level].push(rect);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
|
||||
getTileUrl: function(level, x, y) {
|
||||
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
|
||||
|
@ -10,16 +10,8 @@ $.DziTileSource = function(width, height, tileSize, tileOverlap, tilesUrl, fileF
|
||||
|
||||
this.fileFormat = fileFormat;
|
||||
this.displayRects = displayRects;
|
||||
this.initialize();
|
||||
};
|
||||
|
||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
|
||||
initialize: function() {
|
||||
if (!this.displayRects) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( this.displayRects ) {
|
||||
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
||||
var rect = this.displayRects[i];
|
||||
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
||||
@ -29,7 +21,11 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
this._levelRects[level].push(rect);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||
|
||||
getTileUrl: function(level, x, y) {
|
||||
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
|
||||
|
Loading…
Reference in New Issue
Block a user