Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move popup #1238

Open
lopezvoliver opened this issue Oct 28, 2024 · 1 comment
Open

Move popup #1238

lopezvoliver opened this issue Oct 28, 2024 · 1 comment

Comments

@lopezvoliver
Copy link
Contributor

Updating the location of a Popup should move it to that location, as seen in this jsfiddle:

ipyleaflet-popup-jsfiddle

But in ipyleaflet this doesn't work:

First setup the map:

import ipyleaflet
from ipywidgets import HTML

m = ipyleaflet.Map(center=[51.505, -0.09])
info = HTML("Hello world")

popup = ipyleaflet.Popup(
    location = [51.505, -0.09],
    child = info,
    close_button = True,
    auto_close=True,
    close_on_escape_key=True
)
m.add(popup)

m

Then try to update the popup location in another cell:

popup.location=[51.505, 0]

ipyleaflet-popup-notebook

@lopezvoliver
Copy link
Contributor Author

Here's a workaround:

popup.location = [51.505, 0] 
popup.close_popup()
popup.open_popup()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant