widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.91k stars 141 forks source link

Blank page when rendering MapLibre maps using command line #866

Open giswqs opened 3 days ago

giswqs commented 3 days ago

Solara successfully renders MapLibre maps in a Jupyter notebook. However, when attempting to render the map using the command solara run script.py, the output is a blank page.

# pip install "leafmap[maplibre]"

import leafmap.maplibregl as leafmap
import solara

class Map(leafmap.Map):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.add_basemap("OpenTopoMap")
        self.add_layer_control()

@solara.component
def Page():
    with solara.Column(style={"min-width": "500px"}):
        Map.element()
Page()

image