Full-screen button plugin in a Python Folium map: Closing full screen only works on second click

498 Views Asked by At

I created a map in Folium following the "Fullscreen" example in this notebook.

import folium
from folium import plugins

# Create the map.           
map_ = folium.Map(location        = [45, 3],                   
                  zoom_start      = 4)                              
                                                                                
# Add the full screen button.                                               
plugins.Fullscreen(                                                         
        position                = "topright",                                   
        title                   = "Open full-screen map",                       
        title_cancel            = "Close full-screen map",                      
        force_separate_button   = True,                                         
    ).add_to(map_) 

This creates a map with a "full-screen" button in the top right corner. I click the button once to launch full-screen. However, I have to click the button twice to close full-screen (the first click is ignored). How can I fix this?

0

There are 0 best solutions below