Skip to content

Instantly share code, notes, and snippets.

@ntopulos
Last active March 4, 2021 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntopulos/bbecc8380ea09eb5517e10be3c871b3e to your computer and use it in GitHub Desktop.
Save ntopulos/bbecc8380ea09eb5517e10be3c871b3e to your computer and use it in GitHub Desktop.
!pip install ipyleaflet
from ipyleaflet import Map, Marker
center = (52.204793, 360.121558)
m = Map(center=center, zoom=15)
marker = Marker(location=center, draggable=True)
m.add_layer(marker);
display(m)
# Now that the marker is on the Map, you can drag it with your mouse,
# it will automatically update the `marker.location` attribute in Python
# You can also update the marker location from Python, that will update the
# marker location on the Map:
marker.location = (50, 356)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment