Spaces:
Runtime error
Runtime error
File size: 827 Bytes
d32e3a5 57a058e d32e3a5 57a058e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# -*- coding: utf-8 -*-
"""panel_leafmap.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1t6pTDm97iBCYuNDvlpYgin3mf-6f4Kgn
"""
#!pip install leafmap panel
import leafmap
import panel as pn
pn.extension(sizing_mode="stretch_width")
layer = pn.widgets.Select(options=["Census_Regions16659", "Census_Regions_Labels31526", "States"], name='layer')
def leafmap_viz(layer):
m = leafmap.Map(center=[30, -90], zoom=4)
m.add_census_data(wms="Census 2020", layer=layer)
return m
pn.Column(layer, pn.bind(leafmap_viz, layer))
template = pn.template.BootstrapTemplate(
title="Leapmap Panel App",
sidebar=[layer],
main=[pn.bind(leafmap_viz, layer)],
accent_base_color="#88d8b0",
header_background="#88d8b0",
)
template.servable() |