Merge pull request #378 from heathn/dziQueryParams

Support query parameters in DZI tileSource URL
This commit is contained in:
iangilman 2014-04-14 09:11:24 -07:00
commit 82d5de2127
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) { 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; return options;
@ -151,7 +152,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
* @param {Number} y * @param {Number} y
*/ */
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, 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() { asyncTest('IIIF 1.0 JSON', function() {
testOpen('iiif1_0.json'); testOpen('iiif1_0.json');
}); });