|
import leafmap |
|
import solara |
|
|
|
|
|
|
|
zoom = solara.reactive(2) |
|
center = solara.reactive((20, 0)) |
|
|
|
|
|
eurocrops_pmtiles = "https://s3.us-west-2.amazonaws.com/us-west-2.opendata.source.coop/cholmes/eurocrops/eurocrops-all.pmtiles" |
|
ec_style = leafmap.pmtiles_style(eurocrops_pmtiles) |
|
|
|
|
|
class Map(leafmap.Map): |
|
def __init__(self, **kwargs) -> None: |
|
super().__init__(**kwargs) |
|
self.add_stac_gui() |
|
self.add_pmtiles( |
|
eurocrops_pmtiles, |
|
name="Euro Crops", |
|
style=ec_style, |
|
overlay=True, |
|
show=True, |
|
zoom_to_layer=False, |
|
) |
|
|
|
|
|
@solara.component |
|
def Page(): |
|
with solara.Column(style={"min-width": "500px"}): |
|
|
|
|
|
|
|
|
|
Map.element( |
|
zoom=zoom.value, |
|
on_zoom=zoom.set, |
|
center=center.value, |
|
on_center=center.set, |
|
scroll_wheel_zoom=True, |
|
toolbar_ctrl=False, |
|
data_ctrl=False, |
|
height="780px", |
|
) |
|
|