Skip to content

Commit

Permalink
Fix d2s_tile bug (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Sep 9, 2024
1 parent 3932db9 commit 75d5644
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14104,9 +14104,7 @@ def ee_tile_url(
return None


def d2s_tile(
url: str, titiler_endpoint: str = "https://tt.d2s.org", **kwargs: Any
) -> str:
def d2s_tile(url: str, titiler_endpoint: str = None, **kwargs: Any) -> str:
"""Generate a D2S tile URL with optional API key.
Args:
Expand All @@ -14122,6 +14120,9 @@ def d2s_tile(
ValueError: If the API key is required but not set in the environment variables.
"""

if titiler_endpoint is None:
titiler_endpoint = os.environ.get("TITILER_ENDPOINT", "https://titiler.xyz")

stats = cog_stats(url, titiler_endpoint=titiler_endpoint, **kwargs)
if "detail" in stats:
api_key = get_api_key("D2S_API_KEY")
Expand Down

0 comments on commit 75d5644

Please sign in to comment.