29 pydeck
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
import leafmap.deck as leafmap
import leafmap.deck as leafmap
Create an interactive map.
In [3]:
Copied!
m = leafmap.Map(center=(40, -100), zoom=3)
m
m = leafmap.Map(center=(40, -100), zoom=3)
m
Out[3]:
Add basemap.
In [4]:
Copied!
m = leafmap.Map()
m.add_basemap("OpenTopoMap")
m
m = leafmap.Map()
m.add_basemap("OpenTopoMap")
m
Out[4]:
Add vector data to the map. It supports any GeoPandas supported format, such as GeoJSON, shapefile, KML.
In [5]:
Copied!
m = leafmap.Map()
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(filename, random_color_column="STATEFP")
m
m = leafmap.Map()
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(filename, random_color_column="STATEFP")
m
Out[5]: