Skip to content

Commit

Permalink
Vector: Fix vector visualize (#12443)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 9c0a311e6fdbcef16cb723389db3acfcfc5eb01e
  • Loading branch information
stephencpope authored and Descartes Labs Build committed Feb 8, 2024
1 parent 05ff555 commit f303eb1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions descarteslabs/core/vector/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
from ipyleaflet import VectorTileLayer
from traitlets import Dict
except ImportError:
VectorTileLayer = object
raise ImportError(
"The visualization support in the `descarteslabs.vector` Python package"
" requires the `viz` extra to be installed."
" Please run `pip install descarteslabs[viz]` and try again."
" Alternatively you can install the `ipyleaflet` package directly."
)


class DLVectorTileLayer(VectorTileLayer):
"""
A minimal wrapper around VectorTileLayer to add fetch_options
"""

def __init__(self, *args, **kwargs):
if VectorTileLayer is object:
raise ImportError(
"The visualization support in the `descarteslabs.vector` Python package"
" requires the `viz` extra to be installed."
" Please run `pip install descarteslabs[viz]` and try again."
)
super(DLVectorTileLayer, self).__init__(*args, **kwargs)
self.fetch_options = Dict({"credentials": "include"}).tag(sync=True, o=True)
fetch_options = Dict({"credentials": "include"}).tag(sync=True, o=True)

0 comments on commit f303eb1

Please sign in to comment.