Skip to content

18 point layer

image image image

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.

1
# !pip install leafmap
1
from leafmap import leafmap

Use the toolbar GUI to open a point-type vector dataset.

1
2
m = leafmap.Map()
m

Display a single popup attribute.

1
2
3
m = leafmap.Map()
m.add_point_layer("../data/us_cities.geojson", popup="name", layer_name="US Cities")
m

Display multiple popup attributes.

1
2
3
4
m = leafmap.Map()
url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/us_cities.geojson"
m.add_point_layer(url, popup=["name", "pop_max"], layer_name="US Cities")
m