In [1]:
from birdy import IpyleafletWFS
from ipyleaflet import Map
# Create connection
url = 'http://boreas.ouranos.ca/geoserver/wfs'
version = '2.0.0'
wfs = IpyleafletWFS(url, version)
In [2]:
# Create the map instance
m = Map(center=(47.90, -69.90), zoom=11)
m
In [3]:
# List the available layers
wfs.layer_list
Out[3]:
In [4]:
# Create wfs layer
# Move and zoom to the desired extent before running this cell
# Do NOT zoom too far out, as large GeoJSON layers can be long to load and even cause crashed
basin_style = { 'color': '#d000ff', 'opacity': 1, 'dashArray': '10', 'fillOpacity': 0.0, 'weight': 3 }
lake_style = { 'color': '#00aeff', 'dashArray': '0', 'fillOpacity': 0.5, 'weight': 0.5 }
lakes = wfs.create_wfsgeojson_layer('public:HydroLAKES_poly', m, layer_style=lake_style)
basins = wfs.create_wfsgeojson_layer('public:wshed_bound_n2', m, layer_style=basin_style)
In [5]:
# Add the layer to the map
m.add_layer(basins)
m.add_layer(lakes)
In [6]:
m
In [ ]: