Skip to content

Commit 8ebf16e

Browse files
author
Stefan Kuethe
committed
Fix notebook
1 parent 21ad722 commit 8ebf16e

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "6a777f9b",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"%pip install openlayers"
11+
]
12+
},
13+
{
14+
"cell_type": "markdown",
15+
"id": "fd203e12",
16+
"metadata": {},
17+
"source": [
18+
"# GPX vector source"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"id": "9b026059",
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"import openlayers as ol"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"id": "2cdbc12d",
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"data = \"https://openlayers.org/en/latest/examples/data/gpx/fells_loop.gpx\""
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": null,
44+
"id": "484bec3c",
45+
"metadata": {},
46+
"outputs": [],
47+
"source": [
48+
"gpx = ol.WebGLVectorLayer(\n",
49+
" fit_bounds=True,\n",
50+
" source=ol.VectorSource(url=data, format=ol.formats.GPX()),\n",
51+
" style=ol.FlatStyle(\n",
52+
" circle_fill_color=\"steelblue\",\n",
53+
" circle_stroke_color=\"white\",\n",
54+
" circle_stroke_width=1,\n",
55+
" circle_radius=5,\n",
56+
" stroke_color=\"gray\",\n",
57+
" stroke_width=3,\n",
58+
" ),\n",
59+
")"
60+
]
61+
},
62+
{
63+
"cell_type": "code",
64+
"execution_count": null,
65+
"id": "2cba1466",
66+
"metadata": {},
67+
"outputs": [],
68+
"source": [
69+
"m = ol.MapWidget(layers=[ol.BasemapLayer(), gpx])\n",
70+
"m.add_tooltip()"
71+
]
72+
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": null,
76+
"id": "c21678e9",
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"m"
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"id": "bce02236",
87+
"metadata": {},
88+
"outputs": [],
89+
"source": []
90+
}
91+
],
92+
"metadata": {
93+
"kernelspec": {
94+
"display_name": ".venv",
95+
"language": "python",
96+
"name": "python3"
97+
},
98+
"language_info": {
99+
"codemirror_mode": {
100+
"name": "ipython",
101+
"version": 3
102+
},
103+
"file_extension": ".py",
104+
"mimetype": "text/x-python",
105+
"name": "python",
106+
"nbconvert_exporter": "python",
107+
"pygments_lexer": "ipython3",
108+
"version": "3.11.11"
109+
}
110+
},
111+
"nbformat": 4,
112+
"nbformat_minor": 5
113+
}

0 commit comments

Comments
 (0)