In [1]:
from jupytep.maps.leaflet.layer import WMSLayer
In [2]:
addressWMS = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'
parameters = {'opacity': '0.1', 'transparent': 'true', 'format': 'image/png'}
In [5]:
wmsL = WMSLayer()
wmsL.add_wms_layer(addressWMS, "nameOfLayer", parameters)
wmsL.show_layer()
In [6]:
int_range = widgets.IntSlider()
display(int_range)
In [7]:
def onOpacityChange(change):
wmsL.removeLayer()
x = (str(change['new'] / 100))
wmsL.changeAttributes('opacity', x)
wmsL.showLayer()
int_range.observe(onOpacityChange, names='value')
In [ ]: