Skip to content

Commit 91bddf3

Browse files
committed
Updated notebooks 2023-09-23 UTC
1 parent 8959f8d commit 91bddf3

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

content/notebooks/82_pmtiles.ipynb

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,21 @@
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
46-
"m = leafmap.Map(center=[43.7798, 11.24148], zoom=13)\n",
4746
"url = \"https://open.gishub.org/data/pmtiles/protomaps_firenze.pmtiles\"\n",
47+
"metadata = leafmap.pmtiles_metadata(url)\n",
48+
"print(f\"layer names: {metadata['layer_names']}\")\n",
49+
"print(f\"bounds: {metadata['bounds']}\")"
50+
]
51+
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": null,
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"m = leafmap.Map()\n",
4859
"\n",
49-
"style={\n",
60+
"style = {\n",
5061
" \"version\": 8,\n",
5162
" \"sources\": {\n",
5263
" \"example_source\": {\n",
@@ -73,7 +84,9 @@
7384
" ],\n",
7485
"}\n",
7586
"\n",
76-
"m.add_pmtiles(url, name='PMTiles', style=style, overlay=True, show=True)\n",
87+
"m.add_pmtiles(\n",
88+
" url, name='PMTiles', style=style, overlay=True, show=True, zoom_to_layer=True\n",
89+
")\n",
7790
"m"
7891
]
7992
},
@@ -90,11 +103,22 @@
90103
"metadata": {},
91104
"outputs": [],
92105
"source": [
93-
"m = leafmap.Map(center=[52.963529, 4.756306], zoom=15, height='800px')\n",
94-
"m.add_basemap('CartoDB.DarkMatter')\n",
95106
"url = \"https://storage.googleapis.com/ahp-research/overture/pmtiles/overture.pmtiles\"\n",
107+
"metadata = leafmap.pmtiles_metadata(url)\n",
108+
"print(f\"layer names: {metadata['layer_names']}\")\n",
109+
"print(f\"bounds: {metadata['bounds']}\")"
110+
]
111+
},
112+
{
113+
"cell_type": "code",
114+
"execution_count": null,
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"m = leafmap.Map(height='800px')\n",
119+
"m.add_basemap('CartoDB.DarkMatter')\n",
96120
"\n",
97-
"style={\n",
121+
"style = {\n",
98122
" \"version\": 8,\n",
99123
" \"sources\": {\n",
100124
" \"example_source\": {\n",
@@ -135,7 +159,9 @@
135159
" ],\n",
136160
"}\n",
137161
"\n",
138-
"m.add_pmtiles(url, name='PMTiles', style=style, overlay=True, show=True)\n",
162+
"m.add_pmtiles(\n",
163+
" url, name='PMTiles', style=style, overlay=True, show=True, zoom_to_layer=True\n",
164+
")\n",
139165
"\n",
140166
"legend_dict = {\n",
141167
" 'admins': 'BDD3C7',\n",
@@ -145,7 +171,6 @@
145171
"}\n",
146172
"\n",
147173
"m.add_legend(legend_dict=legend_dict)\n",
148-
"\n",
149174
"m"
150175
]
151176
}

0 commit comments

Comments
 (0)