Skip to content

46 edit vector

image image image

Uncomment the following line to install leafmap if needed.

1
# !pip install leafmap
1
from leafmap import leafmap

Create an interactive map.

1
2
3
m = leafmap.Map(center=(37.712615, -122.386665), zoom=12)
m.add_basemap("HYBRID")
m

Add existing vector data to the map.

1
2
url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/training_samples.geojson"
m.edit_vector(url)

Edit the existing vector data using the drawing tools and save the resulting vector data as GeoJSON, Shapefile, or GeoPackage.

1
m.save_draw_features("data.geojson")