Closed corviday closed 6 years ago
When you set an "opacity" parameter on a wms layer in leaflet, one of two things happens:
It looks like the latter sequence usually happens when the map is first loaded, but the former happens when you switch timestamps or variables. This inconsistency is an issue because ncWMS accepts opacity parameters that are integers between 0 and 100, but Leaflet accepts opacity parameters between 0 and 1.
Not entirely sure what the best way to deal with this is. I wonder if upgrading to a newer version of Leaflet would fix it?
Okay, it looks like when you initialize a layer and pass in a set of params
, anyparams
the layer itself understands are used to initialize the layer. It stores any parameter it doesn't understand and passes them to ncWMS on the assumption that they are WMS parameters.
After the layer is already initialized, it assumes all params
it receives are for WMS, which makes some sense, though it does result in strange behaviours around parameter names used by both ncWMS and Leaflet.
This bug seems to happen on initial load; changing datasets or timestamps fixes it. Need to look at calls to ncWMS and see what opacity value is being passed. If the overlay layers are opaque, context isn't visible to the user.