gee-community/geemap

time_slider not in the Map when I exported as HTML

isaacarroyov opened this issue · 1 comments

I'm creating a map with a slider in it. In the notebook, everything runs fine:

import ee
ee.Initialize()
import geemap
from ipyleaflet import basemaps

# . . .
# . . .

Mapa = geemap.Map(basemap = basemaps.CartoDB.DarkMatter)
Mapa.center_object(geom_mexico, 5)
Mapa.add_time_slider(img_coll_pdsi_tag_month_year, mapVisParamsPDSI,
                     layer_name = "Índice de Severidad de Sequía de Palmer",
                     labels = labels_dates,
                     position='topleft',
                     slider_length = "300px",
                     time_interval=1)
Screenshot 2023-06-02 at 19 19 54

However, when I exported the map:

Mapa.to_html("./../charts_html/Mapa_sequia_meses_1960-2022.html",
             title = "SequiaEnMexico",
             width = "100%", height = "400px")

The slider is not in the HTML file. Am I doing something wrong?

Screenshot 2023-06-02 at 19 17 53

Thanks in advance for the help ✨

giswqs commented

No, ipywidgets won't work when the map is exported as static HTML. You can use voila or solara to develop interactive web apps that support ipywidgets.