gee-community / geemap

A Python package for interactive geospatial analysis and visualization with Google Earth Engine.
https://geemap.org
MIT License
3.46k stars 1.09k forks source link

geemap's add_data causes solara app to crash #2018

Closed usereight8 closed 5 months ago

usereight8 commented 5 months ago

When launching a solara app using geemap's add_data feature it is OK, however after refreshing the page it crashes.

import geemap, solara

zoom = solara.reactive(6.5)
center = solara.reactive((37.95,23.68))

class Map(geemap.Map):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)  
        data = geemap.examples.datasets.countries_geojson
        self.add_data(data, column="POP_EST", scheme="Quantiles", cmap="Blues", legend_title="Population")

@solara.component
def Page():
    with solara.Column(style={"min-width": "500px"}):
        m = Map.element(
            zoom=zoom.value,
            on_zoom=zoom.set,
            center=center.value,
            on_center=center.set,
            scroll_wheel_zoom=True,
            add_google_map=False,
            height="780px",
            Draw_export=True,
            layer_ctrl=True,
        )
giswqs commented 5 months ago

@usereight8 Thank you for reporting. I have fixed this issue in #2019. The Solara web app does not crash any more when refreshing.

Peek 2024-05-24 23-05