Fit Zoomify view to image extent
This commit is contained in:
+1
-1
@@ -24,8 +24,8 @@ var map = new ol.Map({
|
|||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
// adjust zoom levels to those provided by the source
|
// adjust zoom levels to those provided by the source
|
||||||
resolutions: source.getTileGrid().getResolutions(),
|
resolutions: source.getTileGrid().getResolutions(),
|
||||||
zoom: 2,
|
|
||||||
// constrain the center: center cannot be set outside this extent
|
// constrain the center: center cannot be set outside this extent
|
||||||
extent: extent
|
extent: extent
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
map.getView().fit(extent, /** @type {ol.Size} */ (map.getSize()));
|
||||||
|
|||||||
Reference in New Issue
Block a user