Remove extent definition from IIIF example

See
https://github.com/openlayers/openlayers/pull/9430#pullrequestreview-232616993
This commit is contained in:
Lutz Helm
2019-05-03 16:55:49 +02:00
committed by Lutz Helm
parent 4629fe5028
commit 40ea2a8b7e
+5 -5
View File
@@ -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;