Spaces:
Running
Running
Fix duplicate layer bug
Browse files- pages/01_morocco.py +3 -2
- pages/02_libya.py +3 -2
- pages/03_maui.py +3 -2
pages/01_morocco.py
CHANGED
@@ -108,8 +108,9 @@ def add_widgets(m):
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
-
|
112 |
-
|
|
|
113 |
|
114 |
image.observe(change_image, names='value')
|
115 |
|
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
+
if change.new not in m.get_layer_names():
|
112 |
+
mosaic = f'{url}/datasets/{dataset.value}/{image.value}.json'
|
113 |
+
m.add_stac_layer(mosaic, name=image.value, fit_bounds=m.zoom_to_layer)
|
114 |
|
115 |
image.observe(change_image, names='value')
|
116 |
|
pages/02_libya.py
CHANGED
@@ -108,8 +108,9 @@ def add_widgets(m):
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
-
|
112 |
-
|
|
|
113 |
|
114 |
image.observe(change_image, names='value')
|
115 |
|
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
+
if change.new not in m.get_layer_names():
|
112 |
+
mosaic = f'{url}/datasets/{dataset.value}/{image.value}.json'
|
113 |
+
m.add_stac_layer(mosaic, name=image.value, fit_bounds=m.zoom_to_layer)
|
114 |
|
115 |
image.observe(change_image, names='value')
|
116 |
|
pages/03_maui.py
CHANGED
@@ -108,8 +108,9 @@ def add_widgets(m):
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
-
|
112 |
-
|
|
|
113 |
|
114 |
image.observe(change_image, names='value')
|
115 |
|
|
|
108 |
|
109 |
def change_image(change):
|
110 |
if change.new:
|
111 |
+
if change.new not in m.get_layer_names():
|
112 |
+
mosaic = f'{url}/datasets/{dataset.value}/{image.value}.json'
|
113 |
+
m.add_stac_layer(mosaic, name=image.value, fit_bounds=m.zoom_to_layer)
|
114 |
|
115 |
image.observe(change_image, names='value')
|
116 |
|