Support query parameters in DZI tileSource URLs

Any query parameters that are a part of the tileSource URL are added
to the tile URLs.
This commit is contained in:
Heath Nielson 2014-04-10 14:08:19 -06:00
parent aa4b5f6e65
commit c61a22f750
2 changed files with 8 additions and 2 deletions

View File

@ -137,7 +137,8 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
}
if (url && !options.tilesUrl) {
options.tilesUrl = url.replace(/([^\/]+)\.(dzi|xml|js)$/, '$1_files/');
options.tilesUrl = url.replace(/([^\/]+)\.(dzi|xml|js)(\?.*|$)/, '$1_files/');
options.queryParams = url.match(/\?.*/);
}
return options;
@ -151,7 +152,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
* @param {Number} y
*/
getTileUrl: function( level, x, y ) {
return [ this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat ].join( '' );
return [ this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat, this.queryParams ].join( '' );
},

View File

@ -66,6 +66,11 @@
});
// ----------
asyncTest('DZI XML with query parameter', function() {
testOpen('testpattern.xml?param=value');
});
// ----------
asyncTest('IIIF 1.0 JSON', function() {
testOpen('iiif1_0.json');
});