Skip to content

Commit

Permalink
ipyleaflet 0.19 fixes an issue with inverting bounds coordinates
Browse files Browse the repository at this point in the history
This fixes the issue on map coordinates.  Layers appear to still be
inverted.  Note that this will break map bounds in ipyleaflet < 0.19.
  • Loading branch information
manthey committed Jan 16, 2025
1 parent 363a8bb commit 14552fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Bug Fixes

- Fix scaling tiles from stripped tiffs in some instances ([#1773](../../pull/1773))
- Updated jupyter support for ipyleaflet ([#1775](../../pull/1775))

## 1.30.6

Expand Down
13 changes: 2 additions & 11 deletions large_image/tilesource/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
likely lead to crashes. This is only for use in JupyterLab.
"""
import importlib.metadata
import importlib.util
import json
import os
Expand Down Expand Up @@ -276,21 +277,11 @@ def make_map(
crs = dict(
name='PixelSpace',
custom=True,
# Why does this need to be 256?
resolutions=[2 ** (metadata['levels'] - 1 - l) for l in range(20)],

# This works but has x and y reversed
proj4def='+proj=longlat +axis=esu',
bounds=[[0, 0], [metadata['sizeY'], metadata['sizeX']]],
# Why is origin X, Y but bounds Y, X?
bounds=[[0, 0], [metadata['sizeX'], metadata['sizeY']]],
origin=[0, metadata['sizeY']],

# This almost works to fix the x, y reversal, but
# - bounds are weird and other issues occur
# proj4def='+proj=longlat +axis=seu',
# bounds=[[-metadata['sizeX'],-metadata['sizeY']],
# [metadata['sizeX'],metadata['sizeY']]],
# origin=[0,0],
)
layer = layer or self._layer

Expand Down

0 comments on commit 14552fe

Please sign in to comment.