Add zDirection option to IIIF tile source
This commit is contained in:
@@ -21,6 +21,7 @@ function refreshMap(imageInfoUrl) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const extent = [0, -options.size[1], options.size[0], 0];
|
const extent = [0, -options.size[1], options.size[0], 0];
|
||||||
|
options.zDirection = -1;
|
||||||
layer.setSource(new IIIF(options));
|
layer.setSource(new IIIF(options));
|
||||||
map.setView(new View({
|
map.setView(new View({
|
||||||
resolutions: layer.getSource().getTileGrid().getResolutions(),
|
resolutions: layer.getSource().getTileGrid().getResolutions(),
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ import TileImage from './TileImage.js';
|
|||||||
* @property {string} [url] Base URL of the IIIF Image service.
|
* @property {string} [url] Base URL of the IIIF Image service.
|
||||||
* This shoulf be the same as the IIIF Image @id.
|
* This shoulf be the same as the IIIF Image @id.
|
||||||
* @property {Versions} [version=Versions.VERSION2] Service's IIIF Image API version.
|
* @property {Versions} [version=Versions.VERSION2] Service's IIIF Image API version.
|
||||||
|
* @property {number} [zDirection] Indicate which resolution should be used
|
||||||
|
* by a renderer if the views resolution does not match any resolution of the tile source.
|
||||||
|
* If 0, the nearest resolution will be used. If 1, the nearest lower resolution
|
||||||
|
* will be used. If -1, the nearest higher resolution will be used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function formatPercentage(percentage) {
|
function formatPercentage(percentage) {
|
||||||
@@ -242,6 +246,11 @@ class IIIF extends TileImage {
|
|||||||
transition: options.transition
|
transition: options.transition
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
this.zDirection = options.zDirection;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user