I have a Leaflet WMS Layer
layer = new L.tileLayer.wms('https://{s}.url.com/wms?', {
layers: 'Workspace:Layer',
format: 'image/png',
version: '1.3.0',
transparent: true,
styles: 'style1',
});
If I choose 'style2', it works as expected, but I want to change it dynamically with a select box. I tried the following but it does not work:
<select id="styles">
<option selected="selected" onselect="layer.styles='style1';">Style1</option>
<option onselect="layer.styles='style2';">Style2</option>
</select>
I also tried with layer.options.styles=''