Py.Cafe

DocsPricing
  • 1959 Luftbild.tif
  • 1961 Luftbild.tif
  • 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import solara
import leafmap
import os
zoom = solara.reactive(15)
center = solara.reactive(([47.75014502596894, 12.66803026199341]))



class Map(leafmap.Map):

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.add_basemap("ROADMAP")
        #before = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-07-01.tif"
        #after = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-09-13.tif"
        libya = "Libya-2023-07-01.tif"
        before = '1959 Luftbild.tif'
        after = '1961 Luftbild.tif'

        
        #self.add_cog_layer(before, name="Before")
        #self.add_cog_layer(after, name="After")
        #self.add_raster(libya, layer_name="test")
        self.add("layer_manager")
        print(os.path.exists(libya))
        #self.split_map(before, after, left_label="Before", right_label="After", add_close_button=True)


@solara.component
def Page():
    solara.lab.theme.dark = False

    Map.element(
        center = center.value,
        zoom = zoom.value,
        on_center = center.set,
        on_zoom = zoom.set,
        height="750px"

    )

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