Hi,
I've been working on a fire weather monitoring web app using the 4.x (.17 and now .18) JS API and there seems to be an issue with how it's creating the GetLegendGraphics request URL with the custom parameters.
The custom SLD works and applies properly for the GetMap requests, but when it's appending the &SLD=thesource.sld parameter it's using a ? instead of &, and occasionally, converting the = sign doesn't seem to work either.
Here's the little function I'm using to initialize a whole array of layers
function wmsSLDInit(src, attribution, title, name, subtitle, legendsrc, sld) {
return new WMSLayer({
url: src,
copyright: attribution,
title: title,
featureInfoUrl: src,
featureInfoFormat: "application/json",
sublayers: [{
name: name,
title: subtitle,
legendUrl: legendsrc,
popupEnabled: true,
queryable: true
}],
listMode: "hide-children",
customLayerParameters: {SLD: sld}
});
}One test case used the following parameters:
legendsrc: "https://cwfis.cfs.nrcan.gc.ca/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=public%3Atemp_current"
sld: "https://maps.forsite.ca/AtcoMonitoring/styles/CWFIS_TT.sld"
Which resulted in the GetLegendGraphics request of:
https://cwfis.cfs.nrcan.gc.ca/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=public:temp_current?SLD=https%3A%2F%2Fmaps.forsite.ca%2FAtcoMonitoring%2Fstyles%2FCWFIS_TT.sld
which as you can see, does not work. Change the ? and we have
https://cwfis.cfs.nrcan.gc.ca/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=public%3Atemp_current&SLD=https%3A%2F%2Fmaps.forsite.ca%2FAtcoMonitoring%2Fstyles%2FCWFIS_TT.sld
which works.
Similar kind of thing on the Environment Canada DataMart server (https://geo.weather.gc.ca/geomet?) so it's not a quirk of the server, it's how that custom parameter is being appended.
I mean, obviously I can just use the layerlist panels or legend source stuff and generate the URLs and put the resulting images somewhere, but the point is that it's supposed to work, and it does for the GetMap requests.
Anyone else run into this? Known issue?