I think #242 has to be fixed before this can be done, as StylePanel is also a shared instance.
Currently, Portal.details.StylePanel has some special handling in it for NcWMS layers, e.g.:
if (layer.isNcwms()) {
this.ncwmsColourScalePanel.makeNcWMSColourScale(layer);
}
else {
this.ncwmsColourScalePanel.hide();
}
I think we really should be trying to avoid this kind of if/else logic wherever possible.
Keeping StylePanel, I suggest introducing a subclass say NcWmsStylePanel, which has an extra component (the ColourScalePanel).
We could then have layer.getStylePanel() which returns the appropriate implementation depending on what kind of layer it is.
I think #242 has to be fixed before this can be done, as
StylePanel
is also a shared instance.Currently,
Portal.details.StylePanel
has some special handling in it for NcWMS layers, e.g.:I think we really should be trying to avoid this kind of if/else logic wherever possible. Keeping
StylePanel
, I suggest introducing a subclass sayNcWmsStylePanel
, which has an extra component (theColourScalePanel
).We could then have
layer.getStylePanel()
which returns the appropriate implementation depending on what kind of layer it is.