28 publish map
Uncomment the following line to install leafmap if needed.
In [ ]:
Copied!
# !pip install leafmap
# !pip install leafmap
To follow this tutorial, you will need to sign up for an account with https://datapane.com, then install and authenticate the datapane
Python package. More information can be found here.
pip install datapane
datapane login
datapane ping
In [ ]:
Copied!
import leafmap.foliumap as leafmap
import leafmap.foliumap as leafmap
Create an elevation map of North America.
In [ ]:
Copied!
m = leafmap.Map()
m.add_basemap("USGS 3DEP Elevation")
colors = ["006633", "E5FFCC", "662A00", "D8D8D8", "F5F5F5"]
vmin = 0
vmax = 4000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
m = leafmap.Map()
m.add_basemap("USGS 3DEP Elevation")
colors = ["006633", "E5FFCC", "662A00", "D8D8D8", "F5F5F5"]
vmin = 0
vmax = 4000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
Publish the map to datapane.com
In [ ]:
Copied!
m.publish(name="Elevation Map of North America")
m.publish(name="Elevation Map of North America")
Create a land use and land cover map.
In [ ]:
Copied!
m = leafmap.Map()
m.add_basemap("NLCD 2016 CONUS Land Cover")
m.add_legend(builtin_legend="NLCD")
m
m = leafmap.Map()
m.add_basemap("NLCD 2016 CONUS Land Cover")
m.add_legend(builtin_legend="NLCD")
m
Publish the map to datapane.com.
In [ ]:
Copied!
m.publish(name="National Land Cover Database (NLCD) 2016")
m.publish(name="National Land Cover Database (NLCD) 2016")
Create a world population heat map.
In [ ]:
Copied!
m = leafmap.Map()
in_csv = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/world_cities.csv"
m.add_heatmap(
in_csv,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m = leafmap.Map()
in_csv = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/world_cities.csv"
m.add_heatmap(
in_csv,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
In [ ]:
Copied!
colors = ["blue", "lime", "red"]
vmin = 0
vmax = 10000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
colors = ["blue", "lime", "red"]
vmin = 0
vmax = 10000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
Publish the map to datapane.com.
In [ ]:
Copied!
m.publish(name="World Population Heat Map")
m.publish(name="World Population Heat Map")