Skip to content

Commit 9c8c589

Browse files
committed
Add controls to ipyleaflet example
1 parent cfe9ab3 commit 9c8c589

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

2018-11-14-PyParis-widgets/notebooks/3.ipyleaflet.ipynb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"cell_type": "markdown",
2121
"metadata": {},
2222
"source": [
23-
"## Base map"
23+
"# Base map"
2424
]
2525
},
2626
{
@@ -53,6 +53,7 @@
5353
"cell_type": "markdown",
5454
"metadata": {},
5555
"source": [
56+
"# Layers\n",
5657
"## Marker"
5758
]
5859
},
@@ -265,6 +266,32 @@
265266
"m2.add_layer(wind)"
266267
]
267268
},
269+
{
270+
"cell_type": "markdown",
271+
"metadata": {},
272+
"source": [
273+
"# Controls"
274+
]
275+
},
276+
{
277+
"cell_type": "code",
278+
"execution_count": null,
279+
"metadata": {},
280+
"outputs": [],
281+
"source": [
282+
"from ipyleaflet import Map, basemaps, basemap_to_tiles, SplitMapControl\n",
283+
"\n",
284+
"m = Map(center=(42.6824, 365.581), zoom=5)\n",
285+
"\n",
286+
"right_layer = basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, \"2017-11-11\")\n",
287+
"left_layer = basemap_to_tiles(basemaps.NASAGIBS.ModisAquaBands721CR, \"2017-11-11\")\n",
288+
"\n",
289+
"control = SplitMapControl(left_layer=left_layer, right_layer=right_layer)\n",
290+
"m.add_control(control)\n",
291+
"\n",
292+
"m"
293+
]
294+
},
268295
{
269296
"cell_type": "markdown",
270297
"metadata": {},

0 commit comments

Comments
 (0)