You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A workaround for this is to add the ipyleaflet.WidgetControl with an empty HBox widget (or VBox). The Play widget can be added later to the box and works as expected:
importipyleafletimportipywidgetsm=ipyleaflet.Map(zoom=5, center=(40,-120))
play=ipywidgets.Play()
slider=ipywidgets.IntSlider(max=10)
box=ipywidgets.HBox() # Empty boxcontrol=ipyleaflet.WidgetControl(widget=box, position="topright")
ipywidgets.jslink((play,'value'),(slider,'value'))
m.add(control) # Add empty control BEFORE displaying mapdisplay(m)
As mentioned in the title, adding a control with a Play widget after the map is displayed somehow messes up the Play widget.
Here's the code to reproduce the normal behavior:
Here's what happens if we move the
m.add(control)
line to another cell:Here's a slightly larger reproducible example that might be useful:
The text was updated successfully, but these errors were encountered: