Spaces:
Running
Running
Add more apps
Browse files- pages/01_globe.py +8 -5
- pages/02_sidebar.py +8 -6
- pages/03_overture.py +3 -6
- pages/04_pmtiles.py +2 -4
- pages/05_styling.py +31 -0
- pages/06_choropleth.py +34 -0
- pages/07_video.py +32 -0
- requirements.txt +1 -1
pages/01_globe.py
CHANGED
@@ -1,17 +1,20 @@
|
|
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(
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
10 |
return m
|
11 |
|
12 |
|
13 |
@solara.component
|
14 |
def Page():
|
15 |
m = create_map()
|
16 |
-
|
17 |
-
return container
|
|
|
1 |
import solara
|
|
|
2 |
import leafmap.maplibregl as leafmap
|
3 |
|
4 |
|
5 |
def create_map():
|
6 |
|
7 |
+
m = leafmap.Map(
|
8 |
+
style="liberty",
|
9 |
+
projection="globe",
|
10 |
+
height="750px",
|
11 |
+
zoom=2.5,
|
12 |
+
sidebar_visible=True,
|
13 |
+
)
|
14 |
return m
|
15 |
|
16 |
|
17 |
@solara.component
|
18 |
def Page():
|
19 |
m = create_map()
|
20 |
+
return m.to_solara()
|
|
pages/02_sidebar.py
CHANGED
@@ -1,12 +1,16 @@
|
|
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(
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
m.add_ee_layer(asset_id="ESA/WorldCover/v200", opacity=0.8)
|
12 |
m.add_overture_3d_buildings()
|
@@ -21,12 +25,10 @@ def create_map():
|
|
21 |
|
22 |
video = "https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4"
|
23 |
m.add_video_to_sidebar(video, expanded=False)
|
24 |
-
# m.set_sidebar_width(680)
|
25 |
return m
|
26 |
|
27 |
|
28 |
@solara.component
|
29 |
def Page():
|
30 |
m = create_map()
|
31 |
-
|
32 |
-
return container
|
|
|
1 |
import solara
|
|
|
2 |
import leafmap.maplibregl as leafmap
|
3 |
|
4 |
|
5 |
def create_map():
|
6 |
|
7 |
+
m = leafmap.Map(
|
8 |
+
style="dark-matter",
|
9 |
+
projection="globe",
|
10 |
+
height="750px",
|
11 |
+
zoom=2.5,
|
12 |
+
sidebar_visible=True,
|
13 |
+
)
|
14 |
|
15 |
m.add_ee_layer(asset_id="ESA/WorldCover/v200", opacity=0.8)
|
16 |
m.add_overture_3d_buildings()
|
|
|
25 |
|
26 |
video = "https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4"
|
27 |
m.add_video_to_sidebar(video, expanded=False)
|
|
|
28 |
return m
|
29 |
|
30 |
|
31 |
@solara.component
|
32 |
def Page():
|
33 |
m = create_map()
|
34 |
+
return m.to_solara()
|
|
pages/03_overture.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import solara
|
2 |
-
import reacton.ipyvuetify as rv
|
3 |
import leafmap.maplibregl as leafmap
|
4 |
|
5 |
|
@@ -12,16 +11,14 @@ def create_map():
|
|
12 |
bearing=-17,
|
13 |
style="positron",
|
14 |
height="750px",
|
|
|
15 |
)
|
16 |
-
m.
|
17 |
-
m.add_basemap("Esri.WorldImagery", visible=False)
|
18 |
m.add_overture_3d_buildings(template="simple")
|
19 |
-
m.add_layer_control()
|
20 |
return m
|
21 |
|
22 |
|
23 |
@solara.component
|
24 |
def Page():
|
25 |
m = create_map()
|
26 |
-
|
27 |
-
return container
|
|
|
1 |
import solara
|
|
|
2 |
import leafmap.maplibregl as leafmap
|
3 |
|
4 |
|
|
|
11 |
bearing=-17,
|
12 |
style="positron",
|
13 |
height="750px",
|
14 |
+
sidebar_visible=True,
|
15 |
)
|
16 |
+
m.add_basemap("Satellite", visible=False)
|
|
|
17 |
m.add_overture_3d_buildings(template="simple")
|
|
|
18 |
return m
|
19 |
|
20 |
|
21 |
@solara.component
|
22 |
def Page():
|
23 |
m = create_map()
|
24 |
+
return m.to_solara()
|
|
pages/04_pmtiles.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import solara
|
2 |
-
import reacton.ipyvuetify as rv
|
3 |
import leafmap.maplibregl as leafmap
|
4 |
|
5 |
|
@@ -11,8 +10,8 @@ def create_map():
|
|
11 |
height="750px",
|
12 |
center=[-100, 40],
|
13 |
zoom=4,
|
|
|
14 |
)
|
15 |
-
m.create_container(sidebar_visible=True)
|
16 |
|
17 |
building_pmtiles = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2025-04-23/buildings.pmtiles"
|
18 |
road_pmtiles = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2025-04-23/transportation.pmtiles"
|
@@ -54,5 +53,4 @@ def create_map():
|
|
54 |
@solara.component
|
55 |
def Page():
|
56 |
m = create_map()
|
57 |
-
|
58 |
-
return container
|
|
|
1 |
import solara
|
|
|
2 |
import leafmap.maplibregl as leafmap
|
3 |
|
4 |
|
|
|
10 |
height="750px",
|
11 |
center=[-100, 40],
|
12 |
zoom=4,
|
13 |
+
sidebar_visible=True,
|
14 |
)
|
|
|
15 |
|
16 |
building_pmtiles = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2025-04-23/buildings.pmtiles"
|
17 |
road_pmtiles = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2025-04-23/transportation.pmtiles"
|
|
|
53 |
@solara.component
|
54 |
def Page():
|
55 |
m = create_map()
|
56 |
+
return m.to_solara()
|
|
pages/05_styling.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import solara
|
2 |
+
import leafmap.maplibregl as leafmap
|
3 |
+
|
4 |
+
|
5 |
+
def create_map():
|
6 |
+
|
7 |
+
m = leafmap.Map(
|
8 |
+
style="dark-matter",
|
9 |
+
projection="globe",
|
10 |
+
height="750px",
|
11 |
+
zoom=2.5,
|
12 |
+
sidebar_visible=True,
|
13 |
+
)
|
14 |
+
points_url = "https://github.com/opengeos/datasets/releases/download/world/world_cities.geojson"
|
15 |
+
# lines_url = (
|
16 |
+
# "https://github.com/opengeos/datasets/releases/download/vector/cables.geojson"
|
17 |
+
# )
|
18 |
+
# polygons_url = (
|
19 |
+
# "https://github.com/opengeos/datasets/releases/download/world/countries.geojson"
|
20 |
+
# )
|
21 |
+
m.add_geojson(points_url, name="Points", fit_bounds=False)
|
22 |
+
# m.add_geojson(lines_url, name="Lines")
|
23 |
+
# m.add_geojson(polygons_url, name="Polygons")
|
24 |
+
|
25 |
+
return m
|
26 |
+
|
27 |
+
|
28 |
+
@solara.component
|
29 |
+
def Page():
|
30 |
+
m = create_map()
|
31 |
+
return m.to_solara()
|
pages/06_choropleth.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import solara
|
2 |
+
import leafmap.maplibregl as leafmap
|
3 |
+
|
4 |
+
|
5 |
+
def create_map():
|
6 |
+
|
7 |
+
m = leafmap.Map(
|
8 |
+
style="liberty",
|
9 |
+
projection="globe",
|
10 |
+
height="750px",
|
11 |
+
zoom=2.5,
|
12 |
+
sidebar_visible=True,
|
13 |
+
)
|
14 |
+
data = "https://github.com/opengeos/datasets/releases/download/vector/countries.geojson"
|
15 |
+
first_symbol_id = m.find_first_symbol_layer()["id"]
|
16 |
+
m.add_data(
|
17 |
+
data,
|
18 |
+
column="POP_EST",
|
19 |
+
scheme="Quantiles",
|
20 |
+
cmap="Blues",
|
21 |
+
legend_title="Population",
|
22 |
+
name="Population",
|
23 |
+
before_id=first_symbol_id,
|
24 |
+
extrude=True,
|
25 |
+
scale_factor=1000,
|
26 |
+
fit_bounds=False,
|
27 |
+
)
|
28 |
+
return m
|
29 |
+
|
30 |
+
|
31 |
+
@solara.component
|
32 |
+
def Page():
|
33 |
+
m = create_map()
|
34 |
+
return m.to_solara()
|
pages/07_video.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import solara
|
2 |
+
import leafmap.maplibregl as leafmap
|
3 |
+
|
4 |
+
|
5 |
+
def create_map():
|
6 |
+
|
7 |
+
m = leafmap.Map(
|
8 |
+
center=[-122.514426, 37.562984],
|
9 |
+
zoom=17,
|
10 |
+
bearing=-96,
|
11 |
+
height="750px",
|
12 |
+
sidebar_visible=True,
|
13 |
+
)
|
14 |
+
m.add_basemap("Satellite")
|
15 |
+
urls = [
|
16 |
+
"https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4",
|
17 |
+
"https://static-assets.mapbox.com/mapbox-gl-js/drone.webm",
|
18 |
+
]
|
19 |
+
coordinates = [
|
20 |
+
[-122.51596391201019, 37.56238816766053],
|
21 |
+
[-122.51467645168304, 37.56410183312965],
|
22 |
+
[-122.51309394836426, 37.563391708549425],
|
23 |
+
[-122.51423120498657, 37.56161849366671],
|
24 |
+
]
|
25 |
+
m.add_video(urls, coordinates)
|
26 |
+
return m
|
27 |
+
|
28 |
+
|
29 |
+
@solara.component
|
30 |
+
def Page():
|
31 |
+
m = create_map()
|
32 |
+
return m.to_solara()
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
geopandas
|
2 |
-
leafmap>=0.46.
|
3 |
maplibre
|
4 |
solara
|
|
|
1 |
geopandas
|
2 |
+
leafmap>=0.46.7
|
3 |
maplibre
|
4 |
solara
|