File size: 819 Bytes
5ef50b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import solara
import leafmap.maplibregl as leafmap


def create_map():

    m = leafmap.Map(
        style="dark-matter",
        projection="globe",
        height="750px",
        zoom=2.5,
        sidebar_visible=True,
    )
    points_url = "https://github.com/opengeos/datasets/releases/download/world/world_cities.geojson"
    # lines_url = (
    #     "https://github.com/opengeos/datasets/releases/download/vector/cables.geojson"
    # )
    # polygons_url = (
    #     "https://github.com/opengeos/datasets/releases/download/world/countries.geojson"
    # )
    m.add_geojson(points_url, name="Points", fit_bounds=False)
    # m.add_geojson(lines_url, name="Lines")
    # m.add_geojson(polygons_url, name="Polygons")

    return m


@solara.component
def Page():
    m = create_map()
    return m.to_solara()