10 add vector
Adding local vector data (e.g., shp, geojson, kml) to the map
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
import leafmap
import leafmap
In [3]:
Copied!
m = leafmap.Map()
m
m = leafmap.Map()
m
Out[3]:
This demo is based on the ipyleaflet plotting backend. The folium plotting backend does not have the interactive GUI for loading local vector data.
Add a GeoJSON to the map.
In [4]:
Copied!
m = leafmap.Map(center=[0, 0], zoom=2)
in_geojson = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/cable_geo.geojson"
m.add_geojson(in_geojson, layer_name="Cable lines")
m
m = leafmap.Map(center=[0, 0], zoom=2)
in_geojson = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/cable_geo.geojson"
m.add_geojson(in_geojson, layer_name="Cable lines")
m
Out[4]: