CoolFace
Apppublic

awesome-panel/mapwidget_cesium

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
app.py48 linesDownload Raw Back to root
1import os2 3import mapwidget.cesium as mapwidget4 5import panel as pn6 7pn.extension("ipywidgets")8 9try:10    token = os.environ["CESIUM_TOKEN"]11except KeyError as ex:12    raise EnvironmentError(13        "CESIUM_TOKEN environment variable not set. "14        "Sign up for free and get a free Cesium token here https://ion.cesium.com/signup/"15    ) from ex16 17cesium_map = mapwidget.Map(18    center=[40.70605, -74.01177], height="650px", altitude=600, token=token19)20 21component = pn.panel(cesium_map, sizing_mode="stretch_width")22 23description = """# MapWidget24 25Custom Jupyter widgets for creating interactive 2D/3D maps using popular JavaScript libraries with bidirectional communication, such as `Cesium`, `Mapbox`, `MapLibre`, `Leaflet`, and `OpenLayers`.26 27By **Qiusheng Wu**28 29<img src="https://avatars.githubusercontent.com/u/5016453?v=4" style="width:100%;"> 30 31# Cesium32 33Cesium is the open platform for software applications designed to unleash the power of 3D data.34 35<img src="https://images.prismic.io/cesium/a4dc3936-e083-4337-ba48-bb5bba78b2a1_ion_color_white.png" style="width:100%;"> 36"""37 38pn.template.FastListTemplate(39    site="Awesome Panel",40    site_url="https://awesome-panel.org",41    logo="https://panel.holoviz.org/_static/logo_horizontal_dark_theme.png",42    title="mapwidget.cesium",43    theme="dark",44    theme_toggle=False,45    main_layout=None,46    main=[component],47    sidebar=[description],48).servable()