Remove extent definition from IIIF example
See https://github.com/openlayers/openlayers/pull/9430#pullrequestreview-232616993
This commit is contained in:
+5
-5
@@ -21,15 +21,15 @@ function refreshMap(imageInfoUrl) {
|
|||||||
notifyDiv.textContent = 'Data seems to be no valid IIIF image information.';
|
notifyDiv.textContent = 'Data seems to be no valid IIIF image information.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const extent = [0, -options.size[1], options.size[0], 0];
|
|
||||||
options.zDirection = -1;
|
options.zDirection = -1;
|
||||||
layer.setSource(new IIIF(options));
|
const iiifTileSource = new IIIF(options);
|
||||||
|
layer.setSource(iiifTileSource);
|
||||||
map.setView(new View({
|
map.setView(new View({
|
||||||
resolutions: layer.getSource().getTileGrid().getResolutions(),
|
resolutions: iiifTileSource.getTileGrid().getResolutions(),
|
||||||
extent: extent,
|
extent: iiifTileSource.getTileGrid().getExtent(),
|
||||||
constrainOnlyCenter: true
|
constrainOnlyCenter: true
|
||||||
}));
|
}));
|
||||||
map.getView().fit(extent);
|
map.getView().fit(iiifTileSource.getTileGrid().getExtent());
|
||||||
notifyDiv.textContent = '';
|
notifyDiv.textContent = '';
|
||||||
}).catch(function(body) {
|
}).catch(function(body) {
|
||||||
notifyDiv.textContent = 'Could not read image info json. ' + body;
|
notifyDiv.textContent = 'Could not read image info json. ' + body;
|
||||||
|
|||||||
Reference in New Issue
Block a user