Spaces:
Runtime error
Runtime error
Initial commit
Browse files- .github/workflows/sync-hf.yml +2 -2
- README.md +5 -5
- pages/00_home.py +2 -9
- pages/01_globe.py +17 -0
- pages/01_leafmap.py +0 -33
- requirements.txt +1 -1
.github/workflows/sync-hf.yml
CHANGED
|
@@ -10,11 +10,11 @@ jobs:
|
|
| 10 |
sync-to-hub:
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
steps:
|
| 13 |
-
- uses: actions/checkout@
|
| 14 |
with:
|
| 15 |
fetch-depth: 0
|
| 16 |
lfs: true
|
| 17 |
- name: Push to hub
|
| 18 |
env:
|
| 19 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
-
run: git push --force https://giswqs:$HF_TOKEN@huggingface.co/spaces/giswqs/
|
|
|
|
| 10 |
sync-to-hub:
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
steps:
|
| 13 |
+
- uses: actions/checkout@v4
|
| 14 |
with:
|
| 15 |
fetch-depth: 0
|
| 16 |
lfs: true
|
| 17 |
- name: Push to hub
|
| 18 |
env:
|
| 19 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
+
run: git push --force https://giswqs:$HF_TOKEN@huggingface.co/spaces/giswqs/Solara-MapLibre main
|
README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title: Solara
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
-
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Solara MapLibre
|
| 3 |
+
emoji: 📚
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
+
short_description: A solara web app template for MapLibre
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
pages/00_home.py
CHANGED
|
@@ -5,15 +5,8 @@ import solara
|
|
| 5 |
def Page():
|
| 6 |
with solara.Column(align="center"):
|
| 7 |
markdown = """
|
| 8 |
-
## A Solara Template for
|
| 9 |
-
|
| 10 |
-
### Introduction
|
| 11 |
-
|
| 12 |
-
**A collection of [Solara](https://github.com/widgetti/solara) web apps for geospatial applications.**
|
| 13 |
-
|
| 14 |
-
- Web App: <https://giswqs-solara-template.hf.space>
|
| 15 |
-
- GitHub: <https://github.com/opengeos/solara-template>
|
| 16 |
-
- Hugging Face: <https://huggingface.co/spaces/giswqs/solara-template>
|
| 17 |
|
| 18 |
"""
|
| 19 |
|
|
|
|
| 5 |
def Page():
|
| 6 |
with solara.Column(align="center"):
|
| 7 |
markdown = """
|
| 8 |
+
## A Solara Template for MapLibre
|
| 9 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
"""
|
| 12 |
|
pages/01_globe.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import solara
|
| 2 |
+
import reacton.ipyvuetify as rv
|
| 3 |
+
import leafmap.maplibregl as leafmap
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def create_map():
|
| 7 |
+
|
| 8 |
+
m = leafmap.Map(style="liberty", projection="globe")
|
| 9 |
+
m.creater_container()
|
| 10 |
+
return m
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
@solara.component
|
| 14 |
+
def Page():
|
| 15 |
+
m = create_map()
|
| 16 |
+
container = rv.Row(children=[m.container])
|
| 17 |
+
return container
|
pages/01_leafmap.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
import leafmap
|
| 2 |
-
import solara
|
| 3 |
-
|
| 4 |
-
zoom = solara.reactive(2)
|
| 5 |
-
center = solara.reactive((20, 0))
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
class Map(leafmap.Map):
|
| 9 |
-
def __init__(self, **kwargs):
|
| 10 |
-
super().__init__(**kwargs)
|
| 11 |
-
# Add what you want below
|
| 12 |
-
self.add_stac_gui()
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
@solara.component
|
| 16 |
-
def Page():
|
| 17 |
-
with solara.Column(style={"min-width": "500px"}):
|
| 18 |
-
# solara components support reactive variables
|
| 19 |
-
# solara.SliderInt(label="Zoom level", value=zoom, min=1, max=20)
|
| 20 |
-
# using 3rd party widget library require wiring up the events manually
|
| 21 |
-
# using zoom.value and zoom.set
|
| 22 |
-
Map.element( # type: ignore
|
| 23 |
-
zoom=zoom.value,
|
| 24 |
-
on_zoom=zoom.set,
|
| 25 |
-
center=center.value,
|
| 26 |
-
on_center=center.set,
|
| 27 |
-
scroll_wheel_zoom=True,
|
| 28 |
-
toolbar_ctrl=False,
|
| 29 |
-
data_ctrl=False,
|
| 30 |
-
height="780px",
|
| 31 |
-
)
|
| 32 |
-
# solara.Text(f"Zoom: {zoom.value}")
|
| 33 |
-
# solara.Text(f"Center: {center.value}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
leafmap
|
| 2 |
solara
|
| 3 |
geopandas
|
| 4 |
-
|
|
|
|
| 1 |
leafmap
|
| 2 |
solara
|
| 3 |
geopandas
|
| 4 |
+
maplibre
|