Skip to content

Commit

Permalink
Better expose ipyleaflet maps from remote files
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Aug 29, 2023
1 parent d3d2415 commit 4661888
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 1.23.5

### Improvements
- Better expose ipyleaflet maps from remote files ([#1280](../../pull/1280))

### Bug Fixes
- Fix modifying annotations anonymously ([#1279](../../pull/1279))

Expand Down
5 changes: 4 additions & 1 deletion large_image/tilesource/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ def __init__(self, *, ts=None, metadata=None, url=None, gc=None, id=None, resour
self._layer = self._map = self._metadata = None
self._ts = ts
if (not url or not metadata) and gc and (id or resource):
fileId = None
if id is None:
entry = gc.get('resource/lookup', parameters={'path': resource})
if entry:
if entry.get('_modelType') == 'file':
fileId = entry['_id']
id = entry['itemId'] if entry.get('_modelType') == 'file' else entry['_id']
if id:
try:
Expand All @@ -134,7 +137,7 @@ def __init__(self, *, ts=None, metadata=None, url=None, gc=None, id=None, resour
if metadata.get('geospatial') and metadata.get('projection'):
url += suffix
else:
self._ts = self._get_temp_source(gc, id)
self._ts = self._get_temp_source(gc, fileId or id)
if url and metadata:
self._metadata = metadata
self._url = url
Expand Down

0 comments on commit 4661888

Please sign in to comment.