Skip to content

Commit a075372

Browse files
committed
Ensure the view is fitted prior to rendering
1 parent e9a810a commit a075372

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/viewer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ class VolumeImageViewer {
825825
keyboardEventTarget: document
826826
})
827827

828+
view.fit(this[_projection].getExtent(), this[_map].getSize())
829+
828830
/**
829831
* OpenLayer's map has default active interactions
830832
* https://openlayers.org/en/latest/apidoc/module-ol_interaction.html#.defaults
@@ -2258,6 +2260,8 @@ class _NonVolumeImageViewer {
22582260
controls: [],
22592261
keyboardEventTarget: document
22602262
})
2263+
2264+
view.fit(projection.getExtent(), this[_map].getSize())
22612265
}
22622266

22632267
/** Renders the image in the specified viewport container.

0 commit comments

Comments
 (0)