Skip to content

Commit

Permalink
CELE-126 Fix resolution and zoom level relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
aranega committed Jan 15, 2025
1 parent fa71094 commit 3fd1f05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion applications/visualizer/backend/visualizer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def index(request, path="", already_asked=False):
BLACK_TILE = Image.new("RGB", (TILE_SIZE, TILE_SIZE))
BLACK_TILE_BUFFER = io.BytesIO()
BLACK_TILE.save(BLACK_TILE_BUFFER, format="JPEG")
MAX_ZOOM = 6 # Should be set
MAX_ZOOM = 5 # Should be set


def get_tile(request, dataset, slice, x, y, zoom):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,11 @@ const EMStackViewer = () => {
const hasSynapseSegmentations = !!firstActiveDataset.emData.synapsesSegmentationUrl;

const tilegrid = new TileGrid({
minZoom: firstActiveDataset.emData.minZoom + 1,
minZoom: firstActiveDataset.emData.minZoom,
extent: extent,
tileSize: firstActiveDataset.emData.tileSize[0],
resolutions: [0.5, 1, 2, 4, 8, 16, 32].reverse(),
// resolutions: [0.5, 1, 2, 4, 8, 16, 32].reverse(),
resolutions: [0.25, 0.5, 1, 2, 4, 8, 16].reverse(),
});

// const debugLayer = new TileLayer({
Expand All @@ -295,9 +296,9 @@ const EMStackViewer = () => {
target: "emviewer",
layers: [],
view: new View({
zoom: firstActiveDataset.emData.minZoom + 1,
minZoom: firstActiveDataset.emData.minZoom + 1,
maxZoom: firstActiveDataset.emData.maxZoom + 1,
zoom: firstActiveDataset.emData.minZoom,
minZoom: firstActiveDataset.emData.minZoom,
maxZoom: firstActiveDataset.emData.maxZoom,
projection: projection,
center: getCenter(extent),
extent: extent,
Expand Down

0 comments on commit 3fd1f05

Please sign in to comment.