<?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 How to Override STYLES= in WMS getMapUrl to specify a style? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380074#M35284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Through the js api &lt;/SPAN&gt;&lt;A href="http://developers.arcgis.com/en/javascript/jsapi/wmslayer.html"&gt;http://developers.arcgis.com/en/javascript/jsapi/wmslayer.html&lt;/A&gt;&lt;SPAN&gt;, I see no way to override the getMapUrl to inject a STYLES parameter value in the getMapUrl. We added it to the beginning of the string and it worked for awhile to bring back the correct style but something changed on the wms server and now it returns an error that STYLES cannot be defined twice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://lcat.usgs.gov/geoserver/cbntn/wms?STYLES=cbntn_indicators_tsscombo&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=cbntn:cbntn_indicators&amp;amp;WIDTH=800&amp;amp;HEIGHT=500&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-9549994.753131917,4281205.088846833,-7593206.829031925,5504197.541409328"&gt;http://lcat.usgs.gov/geoserver/cbntn/wms?STYLES=cbntn_indicators_tsscombo&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=cbntn:cbntn_indicators&amp;amp;WIDTH=800&amp;amp;HEIGHT=500&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-9549994.753131917,4281205.088846833,-7593206.829031925,5504197.541409328&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We were able to get around this by forcing the request through a proxy and changing it there but is there a better way?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 May 2013 14:14:45 GMT</pubDate>
    <dc:creator>AmyRamsdell</dc:creator>
    <dc:date>2013-05-16T14:14:45Z</dc:date>
    <item>
      <title>How to Override STYLES= in WMS getMapUrl to specify a style?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380074#M35284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Through the js api &lt;/SPAN&gt;&lt;A href="http://developers.arcgis.com/en/javascript/jsapi/wmslayer.html"&gt;http://developers.arcgis.com/en/javascript/jsapi/wmslayer.html&lt;/A&gt;&lt;SPAN&gt;, I see no way to override the getMapUrl to inject a STYLES parameter value in the getMapUrl. We added it to the beginning of the string and it worked for awhile to bring back the correct style but something changed on the wms server and now it returns an error that STYLES cannot be defined twice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://lcat.usgs.gov/geoserver/cbntn/wms?STYLES=cbntn_indicators_tsscombo&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=cbntn:cbntn_indicators&amp;amp;WIDTH=800&amp;amp;HEIGHT=500&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-9549994.753131917,4281205.088846833,-7593206.829031925,5504197.541409328"&gt;http://lcat.usgs.gov/geoserver/cbntn/wms?STYLES=cbntn_indicators_tsscombo&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=cbntn:cbntn_indicators&amp;amp;WIDTH=800&amp;amp;HEIGHT=500&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-9549994.753131917,4281205.088846833,-7593206.829031925,5504197.541409328&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We were able to get around this by forcing the request through a proxy and changing it there but is there a better way?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 14:14:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380074#M35284</guid>
      <dc:creator>AmyRamsdell</dc:creator>
      <dc:date>2013-05-16T14:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Override STYLES= in WMS getMapUrl to specify a style?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380075#M35285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use &lt;/SPAN&gt;&lt;A href="http://developers.arcgis.com/en/javascript/jsapi/namespace_esri.html#setrequestprecallback"&gt;setRequestPreCallback&lt;/A&gt;&lt;SPAN&gt; to manipulate the URL for the request before it's sent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 15:16:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380075#M35285</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2013-05-16T15:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Override STYLES= in WMS getMapUrl to specify a style?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380076#M35286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have been unsuccessful at getting this to fire for a wms layer.&amp;nbsp; Putting an alert in the function passed to esri.setRequestPreCallback never fires when adding the WMS Layer but we can verify that it fires for other layers including a KML layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't believe it has anything to do with the creation of the wms layer but below is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var wmsLayerInfo = new esri.layers.WMSLayerInfo({name:"cbntn:cbntn_indicators",title:"WMS Layer"});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var info = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfos: [wmsLayerInfo],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent: chesMap.map.extent
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var wms = new esri.layers.WMSLayer(url,{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resourceInfo: info,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayers: ["cbntn:cbntn_indicators"],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: ''+chesMap.tempModel.getLabel(chesMap.tempItem)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380076#M35286</guid>
      <dc:creator>AmyRamsdell</dc:creator>
      <dc:date>2021-12-11T17:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to Override STYLES= in WMS getMapUrl to specify a style?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380077#M35287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are correct, setRequestPreCallback does not fire for WMS layers. My mistake. I do not see a clear workaround for this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 13:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-override-styles-in-wms-getmapurl-to-specify/m-p/380077#M35287</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2013-05-17T13:42:42Z</dc:date>
    </item>
  </channel>
</rss>

