# !pip install leafmap
Specify the file path to the CSV. It can either be a file locally or on the Internet.
filepath = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/us_cities.csv"
Use the ipyleaflet plotting backend.
import leafmap.leafmap as leafmap
Specify the latitude
, longitude
, and value
columns to create the heat map.
m = leafmap.Map()
m.add_heatmap(
filepath,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m
Use the folium plotting backend.
import leafmap.foliumap as leafmap
Specify the latitude
, longitude
, and value
columns to create the heat map.
m = leafmap.Map()
m.add_heatmap(
filepath,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m