18 point layer
Adding a point layer with popup attributes to the map
The notebook requires the ipyleaflet plotting backend. Folium is not supported. The point dataset can be any geopandas-supported file stored locally or online.
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
from leafmap import leafmap
from leafmap import leafmap
Use the toolbar GUI to open a point-type vector dataset.
In [3]:
Copied!
m = leafmap.Map()
m
m = leafmap.Map()
m
Display a single popup attribute.
In [4]:
Copied!
m = leafmap.Map()
m.add_point_layer("../data/us_cities.geojson", popup="name", layer_name="US Cities")
m
m = leafmap.Map()
m.add_point_layer("../data/us_cities.geojson", popup="name", layer_name="US Cities")
m
Display multiple popup attributes.
In [5]:
Copied!
m = leafmap.Map()
url = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.geojson"
m.add_point_layer(url, popup=["name", "pop_max"], layer_name="US Cities")
m
m = leafmap.Map()
url = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.geojson"
m.add_point_layer(url, popup=["name", "pop_max"], layer_name="US Cities")
m
Last update:
2022-03-14