File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+
2+
3+ import marimo
4+
5+ __generated_with = "0.13.2"
6+ app = marimo .App (width = "medium" )
7+
8+
9+ @app .cell
10+ def _ ():
11+ import marimo as mo
12+ import openlayers as ol
13+ ol .__version__
14+ return mo , ol
15+
16+
17+ @app .cell
18+ def _ ():
19+ data = "https://maplibre.org/maplibre-gl-js/docs/assets/us_states.geojson"
20+ return (data ,)
21+
22+
23+ @app .cell
24+ def _ (data , ol ):
25+ vector = ol .VectorLayer (
26+ # background="gray",
27+ source = ol .VectorSource (url = data ),
28+ fit_bounds = True
29+ )
30+ return (vector ,)
31+
32+
33+ @app .cell
34+ def _ (ol , vector ):
35+ m = ol .MapWidget (layers = [ol .basemaps .CartoBasemapLayer (), vector ])
36+ m .add_tooltip ()
37+ m .add_select_interaction ()
38+ return (m ,)
39+
40+
41+ @app .cell
42+ def _ (m , mo ):
43+ w = mo .ui .anywidget (m )
44+ return (w ,)
45+
46+
47+ @app .cell
48+ def _ (w ):
49+ w
50+ return
51+
52+
53+ @app .cell
54+ def _ (w ):
55+ [feat ["properties" ] for feat in w .value ["features" ]["selected" ] if w .value ["features" ]]
56+ return
57+
58+
59+ @app .cell
60+ def _ ():
61+ return
62+
63+
64+ if __name__ == "__main__" :
65+ app .run ()
You can’t perform that action at this time.
0 commit comments