Skip to content

Commit

Permalink
CELE-126 Constraint zooms to a working version with OL
Browse files Browse the repository at this point in the history
  • Loading branch information
aranega committed Jan 14, 2025
1 parent 8001f8e commit fa71094
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const EMStackViewer = () => {
const hasSynapseSegmentations = !!firstActiveDataset.emData.synapsesSegmentationUrl;

const tilegrid = new TileGrid({
minZoom: firstActiveDataset.emData.minZoom, // tiles for zoom 0 not available in the dataset
minZoom: firstActiveDataset.emData.minZoom + 1,
extent: extent,
tileSize: firstActiveDataset.emData.tileSize[0],
resolutions: [0.5, 1, 2, 4, 8, 16, 32].reverse(),
Expand All @@ -295,10 +295,14 @@ const EMStackViewer = () => {
target: "emviewer",
layers: [],
view: new View({
zoom: firstActiveDataset.emData.minZoom + 1,
minZoom: firstActiveDataset.emData.minZoom + 1,
maxZoom: firstActiveDataset.emData.maxZoom + 1,
projection: projection,
center: getCenter(extent),
extent: extent,
resolutions: tilegrid.getResolutions(), // forces view zoom options
constrainOnlyCenter: true,
}),
controls: [scale],
interactions: interactions,
Expand Down

0 comments on commit fa71094

Please sign in to comment.