Spaces:
Sleeping
Sleeping
wip
Browse files
app.py
CHANGED
@@ -180,11 +180,7 @@ def pad_style(paint, alpha):
|
|
180 |
## Map controls sidebar
|
181 |
|
182 |
with st.sidebar:
|
183 |
-
"## Basemaps"
|
184 |
-
if st.toggle("Shaded Relief Topo"):
|
185 |
-
m.add_basemap("Esri.WorldShadedRelief")
|
186 |
|
187 |
-
|
188 |
"## Protected Areas"
|
189 |
|
190 |
if st.toggle("PAD US-3", True):
|
@@ -208,7 +204,8 @@ with st.sidebar:
|
|
208 |
style_choice = st.radio("Color protected Areas by", style_options)
|
209 |
style = pad_style(style_options[style_choice], alpha)
|
210 |
m.add_pmtiles(pad_pmtiles, name="Protected Areas (PAD-US-3)", style=style, overlay=True, show=True, zoom_to_layer=False)
|
211 |
-
|
|
|
212 |
|
213 |
"## Data layers"
|
214 |
if st.toggle("Species Richness", True):
|
@@ -230,7 +227,6 @@ with st.sidebar:
|
|
230 |
if st.toggle("Carbon Lost (2002-2022)"):
|
231 |
m.add_cog_layer("https://data.source.coop/vizzuality/lg-land-carbon-data/deforest_carbon_100m_cog.tif",
|
232 |
palette="reds", name="Carbon Lost (2002-2022)", transparent_bg=True, opacity = 0.8, zoom_to_layer=False)
|
233 |
-
|
234 |
|
235 |
if st.toggle("Irrecoverable Carbon"):
|
236 |
m.add_cog_layer("https://data.source.coop/cboettig/carbon/cogs/irrecoverable_c_total_2018.tif",
|
@@ -254,6 +250,11 @@ with st.sidebar:
|
|
254 |
# "custom"]
|
255 |
# )
|
256 |
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
"## Additional elements"
|
259 |
# Fire Polygons, USGS
|
@@ -275,22 +276,11 @@ with st.sidebar:
|
|
275 |
m.add_pmtiles(usgs, name="Fire", style=combined_style, overlay=True, show=True, zoom_to_layer=False)
|
276 |
|
277 |
|
278 |
-
# -
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
|
284 |
|
285 |
# +
|
286 |
|
287 |
-
|
288 |
-
# paint_fill
|
289 |
-
|
290 |
-
# +
|
291 |
-
|
292 |
-
# m.add_legend(legend_dict=legend_dict)
|
293 |
-
|
294 |
m.to_streamlit(height=700)
|
295 |
# -
|
296 |
|
|
|
180 |
## Map controls sidebar
|
181 |
|
182 |
with st.sidebar:
|
|
|
|
|
|
|
183 |
|
|
|
184 |
"## Protected Areas"
|
185 |
|
186 |
if st.toggle("PAD US-3", True):
|
|
|
204 |
style_choice = st.radio("Color protected Areas by", style_options)
|
205 |
style = pad_style(style_options[style_choice], alpha)
|
206 |
m.add_pmtiles(pad_pmtiles, name="Protected Areas (PAD-US-3)", style=style, overlay=True, show=True, zoom_to_layer=False)
|
207 |
+
## Add legend based on selected style?
|
208 |
+
# m.add_legend(legend_dict=legend_dict)
|
209 |
|
210 |
"## Data layers"
|
211 |
if st.toggle("Species Richness", True):
|
|
|
227 |
if st.toggle("Carbon Lost (2002-2022)"):
|
228 |
m.add_cog_layer("https://data.source.coop/vizzuality/lg-land-carbon-data/deforest_carbon_100m_cog.tif",
|
229 |
palette="reds", name="Carbon Lost (2002-2022)", transparent_bg=True, opacity = 0.8, zoom_to_layer=False)
|
|
|
230 |
|
231 |
if st.toggle("Irrecoverable Carbon"):
|
232 |
m.add_cog_layer("https://data.source.coop/cboettig/carbon/cogs/irrecoverable_c_total_2018.tif",
|
|
|
250 |
# "custom"]
|
251 |
# )
|
252 |
|
253 |
+
"## Basemaps"
|
254 |
+
if st.toggle("Shaded Relief Topo"):
|
255 |
+
m.add_basemap("Esri.WorldShadedRelief")
|
256 |
+
|
257 |
+
|
258 |
|
259 |
"## Additional elements"
|
260 |
# Fire Polygons, USGS
|
|
|
276 |
m.add_pmtiles(usgs, name="Fire", style=combined_style, overlay=True, show=True, zoom_to_layer=False)
|
277 |
|
278 |
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
|
281 |
# +
|
282 |
|
283 |
+
# And here we go!
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
m.to_streamlit(height=700)
|
285 |
# -
|
286 |
|