Py.Cafe

Mr-bob-kou/

mapwidget-maplibre-3Dtest-0

3D Visualization with Mapwidget Maplibre

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#import leafmap.maplibregl as leafmap
import mapwidget.maplibre as mapwidget
import solara


zoom = solara.reactive(5)
center = solara.reactive(([24.08085924623178, 120.55892773097916]))


@solara.component
def Page():
    solara.lab.theme.dark = False
    #solara.SliderInt(label="Zoom level", value=zoom, min=1, max=20)

    mapwidget.Map.element(
        center = center.value,
        zoom = zoom.value,
        on_center = center.set,
        on_zoom = zoom.set,
        height="800px",
        #width="100%",
        #pitch=60, 
        #basemap="satellite",
    )


    solara.Text(f"Center: {center.value}")
    solara.Text(f"Zoom: {zoom.value}")