AnsweredAssumed Answered

Setting STYLES parameter in WMSMapLayer

Question asked by ncameron on Feb 15, 2018

Hi All,

 

I'm loading up a WMSMapLayer ok. But I can't seem to set the STYLES parameter in GetMap requests.

 

I need something similar to the following url to be sent with each request. Currently the STYLES parameter is always empty.

http://www.somewmsurl?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=-61.7733927083513094657974,83.8673916720936318824897,11.7276043757079584395342,179.999995508414627920502&WIDTH=1001&HEIGHT=765&LAYERS=LayerABC&STYLES=group2&EXCEPTIONS=XML&FORMAT=image/png&BGCOLOR=0xFEFFFF&TRANSPARENT=TRUE

 

I've tried adding custom parameters to a IWMSMapLayer3 as below, but that just appends the STYLES parameter to the end of the url with the empty STYLES parameter still existing beforehand, so it doesn't work.

IWMSMapLayer3 wms3 = (IWMSMapLayer3)wmsMapLayer;
IPropertySet customProps = new PropertySet();
customProps.SetProperty("STYLES", "group2");
wms3.CustomParameters = customProps;               

 

I've also tried using the Style property of the IWMSLayer2 interface. This property is of type IWMSLayerStyleDescription.  https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IWMSLayer2_Style.htm 

IWMSLayerStyleDescription doesn't seem to have any class that implements it..not that I can find anyway, so I can't instantiate the Style property??

 

I'd even be willing to intercept the request before it's sent and manually change the url if that's the only option, anyone know of an event or interception point where I could do this though?

 

Thanks!

Outcomes