Setting STYLES parameter in WMSMapLayer

356
0
02-15-2018 09:25 PM
NickCameron2
New Contributor III

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.77339270835130...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!

Tags (4)
0 Kudos
0 Replies