mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +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.fileFormat = fileFormat;
|
||||||
this.displayRects = displayRects;
|
this.displayRects = displayRects;
|
||||||
this.initialize();
|
|
||||||
};
|
if ( this.displayRects ) {
|
||||||
|
|
||||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
if (!this.displayRects) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
||||||
var rect = this.displayRects[i];
|
var rect = this.displayRects[i];
|
||||||
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
||||||
@ -2611,7 +2603,11 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
|||||||
this._levelRects[level].push(rect);
|
this._levelRects[level].push(rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||||
|
|
||||||
getTileUrl: function(level, x, y) {
|
getTileUrl: function(level, x, y) {
|
||||||
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
|
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.fileFormat = fileFormat;
|
||||||
this.displayRects = displayRects;
|
this.displayRects = displayRects;
|
||||||
this.initialize();
|
|
||||||
};
|
if ( this.displayRects ) {
|
||||||
|
|
||||||
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
if (!this.displayRects) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
for (var i = this.displayRects.length - 1; i >= 0; i--) {
|
||||||
var rect = this.displayRects[i];
|
var rect = this.displayRects[i];
|
||||||
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
for (var level = rect.minLevel; level <= rect.maxLevel; level++) {
|
||||||
@ -29,7 +21,11 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
|||||||
this._levelRects[level].push(rect);
|
this._levelRects[level].push(rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
||||||
|
|
||||||
getTileUrl: function(level, x, y) {
|
getTileUrl: function(level, x, y) {
|
||||||
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
|
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
|
||||||
|
Loading…
Reference in New Issue
Block a user