<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Setting STYLES parameter in WMSMapLayer in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-styles-parameter-in-wmsmaplayer/m-p/392213#M10445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm loading up a WMSMapLayer ok. But I can't seem to set the STYLES parameter in GetMap requests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need something similar to the following url to be sent with each request. Currently the STYLES parameter is always empty.&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.somewmsurl%3FSERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetMap%26CRS%3DEPSG%3A4326%26BBOX%3D-61.7733927083513094657974%2C83.8673916720936318824897%2C11.7276043757079584395342%2C179.999995508414627920502%26WIDTH%3D1001%26HEIGHT%3D765%26LAYERS%3DLayerABC%26" target="_blank"&gt;http://www.somewmsurl?SERVICE=WMS&amp;amp;VERSION=1.3.0&amp;amp;REQUEST=GetMap&amp;amp;CRS=EPSG:4326&amp;amp;BBOX=-61.7733927083513094657974,83.8673916720936318824897,11.7276043757079584395342,179.999995508414627920502&amp;amp;WIDTH=1001&amp;amp;HEIGHT=765&amp;amp;LAYERS=LayerABC&amp;amp;&lt;/A&gt;&lt;STRONG&gt;STYLES=group2&lt;/STRONG&gt;&amp;amp;EXCEPTIONS=XML&amp;amp;FORMAT=image/png&amp;amp;BGCOLOR=0xFEFFFF&amp;amp;TRANSPARENT=TRUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;IWMSMapLayer3 wms3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IWMSMapLayer3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;wmsMapLayer&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
IPropertySet customProps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PropertySet&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
customProps&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetProperty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"STYLES"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"group2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
wms3&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CustomParameters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; customProps&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried using the Style property of the&amp;nbsp;IWMSLayer2 interface. This property is of type IWMSLayerStyleDescription.&amp;nbsp;&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IWMSLayer2_Style.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IWMSLayer2_Style.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:58:30 GMT</pubDate>
    <dc:creator>NickCameron2</dc:creator>
    <dc:date>2021-12-11T17:58:30Z</dc:date>
    <item>
      <title>Setting STYLES parameter in WMSMapLayer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-styles-parameter-in-wmsmaplayer/m-p/392213#M10445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm loading up a WMSMapLayer ok. But I can't seem to set the STYLES parameter in GetMap requests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need something similar to the following url to be sent with each request. Currently the STYLES parameter is always empty.&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.somewmsurl%3FSERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetMap%26CRS%3DEPSG%3A4326%26BBOX%3D-61.7733927083513094657974%2C83.8673916720936318824897%2C11.7276043757079584395342%2C179.999995508414627920502%26WIDTH%3D1001%26HEIGHT%3D765%26LAYERS%3DLayerABC%26" target="_blank"&gt;http://www.somewmsurl?SERVICE=WMS&amp;amp;VERSION=1.3.0&amp;amp;REQUEST=GetMap&amp;amp;CRS=EPSG:4326&amp;amp;BBOX=-61.7733927083513094657974,83.8673916720936318824897,11.7276043757079584395342,179.999995508414627920502&amp;amp;WIDTH=1001&amp;amp;HEIGHT=765&amp;amp;LAYERS=LayerABC&amp;amp;&lt;/A&gt;&lt;STRONG&gt;STYLES=group2&lt;/STRONG&gt;&amp;amp;EXCEPTIONS=XML&amp;amp;FORMAT=image/png&amp;amp;BGCOLOR=0xFEFFFF&amp;amp;TRANSPARENT=TRUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;IWMSMapLayer3 wms3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IWMSMapLayer3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;wmsMapLayer&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
IPropertySet customProps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PropertySet&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
customProps&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetProperty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"STYLES"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"group2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
wms3&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CustomParameters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; customProps&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried using the Style property of the&amp;nbsp;IWMSLayer2 interface. This property is of type IWMSLayerStyleDescription.&amp;nbsp;&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IWMSLayer2_Style.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IWMSLayer2_Style.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/setting-styles-parameter-in-wmsmaplayer/m-p/392213#M10445</guid>
      <dc:creator>NickCameron2</dc:creator>
      <dc:date>2021-12-11T17:58:30Z</dc:date>
    </item>
  </channel>
</rss>

