Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Last active May 21, 2024 18:54
Show Gist options
  • Save gadenbuie/621159ebb65c6bede63a66132a38b88e to your computer and use it in GitHub Desktop.
Save gadenbuie/621159ebb65c6bede63a66132a38b88e to your computer and use it in GitHub Desktop.
ipyleaflet-popup
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from ipyleaflet import Map, Marker, Popup\n",
"from ipywidgets import HTML"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5e91f2210a9e48e2a4107657710a4613",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[50.6252978589571, 0.34580993652344], controls=(ZoomControl(options=['position', 'zoom_in_text', 'z…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"map = Map(center=(50.6252978589571, 0.34580993652344), zoom=3)\n",
"popup = Popup(child=HTML(value=\"<strong>Hello</strong>, <em>World!</em>\"))\n",
"point = Marker(location=(52.204793, 0.121558), draggable=False, popup=popup)\n",
"map.add(point)\n",
"display(map)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in -o requirements.txt
appnope==0.1.4
# via ipykernel
asttokens==2.4.1
# via stack-data
branca==0.7.2
# via ipyleaflet
comm==0.2.2
# via
# ipykernel
# ipywidgets
debugpy==1.8.1
# via ipykernel
decorator==5.1.1
# via ipython
executing==2.0.1
# via stack-data
ipykernel==6.29.4
ipyleaflet==0.19.1
ipython==8.24.0
# via
# ipykernel
# ipywidgets
ipywidgets==8.1.2
# via ipyleaflet
jedi==0.19.1
# via ipython
jinja2==3.1.4
# via branca
jupyter-client==8.6.1
# via ipykernel
jupyter-core==5.7.2
# via
# ipykernel
# jupyter-client
jupyter-leaflet==0.19.1
# via ipyleaflet
jupyterlab-widgets==3.0.10
# via ipywidgets
markupsafe==2.1.5
# via jinja2
matplotlib-inline==0.1.7
# via
# ipykernel
# ipython
nest-asyncio==1.6.0
# via ipykernel
packaging==24.0
# via ipykernel
parso==0.8.4
# via jedi
pexpect==4.9.0
# via ipython
platformdirs==4.2.2
# via jupyter-core
prompt-toolkit==3.0.43
# via ipython
psutil==5.9.8
# via ipykernel
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
pygments==2.18.0
# via ipython
python-dateutil==2.9.0.post0
# via jupyter-client
pyzmq==26.0.3
# via
# ipykernel
# jupyter-client
six==1.16.0
# via
# asttokens
# python-dateutil
stack-data==0.6.3
# via ipython
tornado==6.4
# via
# ipykernel
# jupyter-client
traitlets==5.14.3
# via
# comm
# ipykernel
# ipython
# ipywidgets
# jupyter-client
# jupyter-core
# matplotlib-inline
# traittypes
traittypes==0.2.1
# via ipyleaflet
wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.10
# via ipywidgets
xyzservices==2024.4.0
# via ipyleaflet
@gadenbuie
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment