Skip to content

Commit 65a8761

Browse files
authored
Merge pull request #868 from jmp75/docs
Add doc section for Map on basic layout options. Issue #750
2 parents 126fce5 + d324c65 commit 65a8761

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/source/api_reference/map.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ You can add multiple layers and controls to the map, using the ``add_layer``/``a
3434

3535
m
3636

37+
As a Jupyter interactive widget, the layout of the ``Map`` object is specified by a Layout attribute. See `Layout and Styling of Jupyter widgets <https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Styling.html/>`_ for details.
38+
39+
.. jupyter-execute::
40+
41+
from ipyleaflet import Map, basemaps, basemap_to_tiles
42+
from ipywidgets import Layout
43+
44+
m = Map(
45+
basemap=basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, "2017-04-08"),
46+
center=(52.204793, 360.121558),
47+
zoom=4,
48+
layout=Layout(width='80%', height='500px')
49+
)
50+
51+
m.add_layer(Marker(location=(52.204793, 360.121558)))
52+
53+
m
54+
3755
Save to HTML
3856
------------
3957

0 commit comments

Comments
 (0)