I am new to the ESRI js API 4.15. I have understood the way the WMSLayers work on the API. The issue I am having is with the Legend for the WMSLayer. The legendUrl under the WMSLayers/sublayers is a GeoServer end point with some custom Parameters. The WMS Layer gets added to the map just fine.... But the Legend does not appear as the URL get tacked together for both the getMap and GetLegendGraphic. So the Image does not appear. Can anyone help me with this?
Here is snapshot of what is happening.
Here is my code :