Skip to content

Commit ae98993

Browse files
committed
fix api_key parameter passing in the basemaps tile url
1 parent fcf7947 commit ae98993

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

planet_explorer/gui/pe_basemap_layer_widget.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
TILE_URL_TEMPLATE = (
6161
"https://tiles.planet.com/basemaps/v1/planet-tiles/"
62-
"%s/gmap/{z}/{x}/{y}.png?api_key=%s"
62+
"%s/gmap/{z}/{x}/{y}.png"
6363
)
6464

6565

@@ -390,14 +390,17 @@ def change_source(self):
390390
name, mosaicid = self.mosaics[value]
391391
tile_url = TILE_URL_TEMPLATE % (
392392
mosaicid,
393-
str(api_key),
394393
)
394+
395+
tile_url = f"{tile_url}?{quote(f'&api_key={str(api_key)}')}"
396+
395397
self.layer.setCustomProperty(PLANET_CURRENT_MOSAIC, name)
396398
else:
397399
tile_url = f"{self.layerurl}/" f"{quote(f'&api_key={api_key}')}"
398400

399401
proc = self.renderingOptionsWidget.process()
400402
ramp = self.renderingOptionsWidget.ramp()
403+
401404
procparam = quote(f"&proc={proc}") if proc != "default" else ""
402405
rampparam = quote(f"&color={ramp}") if ramp else ""
403406
tokens = self.layer.source().split("&")

0 commit comments

Comments
 (0)