Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker image error #510

Merged
merged 2 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM jupyter/scipy-notebook:latest
RUN mamba install -c conda-forge leafmap geopandas localtileserver osmnx -y && \
pip install -U leafmap && \
pip install -U leafmap jsonschema==4.18.0 && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

Expand Down
7 changes: 5 additions & 2 deletions leafmap/foliumap.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ def add_cog_layer(
shown: Optional[bool] = True,
bands: Optional[List] = None,
titiler_endpoint: Optional[str] = None,
zoom_to_layer=True,
**kwargs,
):
"""Adds a COG TileLayer to the map.
Expand All @@ -958,6 +959,7 @@ def add_cog_layer(
shown (bool, optional): A flag indicating whether the layer should be on by default. Defaults to True.
bands (list, optional): A list of bands to use. Defaults to None.
titiler_endpoint (str, optional): TiTiler endpoint. Defaults to "https://titiler.xyz".
zoom_to_layer (bool, optional): Whether to zoom to the layer extent. Defaults to True.
**kwargs: Arbitrary keyword arguments, including bidx, expression, nodata, unscale, resampling, rescale,
color_formula, colormap, colormap_name, return_mask. See https://developmentseed.org/titiler/endpoints/cog/
and https://cogeotiff.github.io/rio-tiler/colormap/. To select a certain bands, use bidx=[1, 2, 3].
Expand All @@ -972,8 +974,9 @@ def add_cog_layer(
opacity=opacity,
shown=shown,
)
self.fit_bounds([[bounds[1], bounds[0]], [bounds[3], bounds[2]]])
arc_zoom_to_extent(bounds[0], bounds[1], bounds[2], bounds[3])
if zoom_to_layer:
self.fit_bounds([[bounds[1], bounds[0]], [bounds[3], bounds[2]]])
arc_zoom_to_extent(bounds[0], bounds[1], bounds[2], bounds[3])

def add_cog_mosaic(self, **kwargs):
raise NotImplementedError(
Expand Down