<?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 Re: Adding a WMS layer with a customized style in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333579#M30791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like custom styles are not supported in ESRI's WMSLayer implementation, so your only option is likely to create a custom WMS Layer type that you can use instead.&amp;nbsp; This will allow you to manually set the STYLES parameter.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See this sample:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html"&gt;https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Feb 2014 20:16:46 GMT</pubDate>
    <dc:creator>JasonGreenlaw</dc:creator>
    <dc:date>2014-02-21T20:16:46Z</dc:date>
    <item>
      <title>Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333574#M30786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to add a WMS Service that's hosted elsewhere to one of my webmaps.&amp;nbsp; The default layer has a color scheme that doesn't really match what we're trying to do with our map, so the hosts of the service offered to set up a new style for us using colors that better fit our map.&amp;nbsp; They sent me a URL directly to the layer with the style, but I have no idea how to add that to my map.&amp;nbsp; Is this possible via JavaScript?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For reference, here's the URL I was sent: &lt;/SPAN&gt;&lt;A href="http://oyster.ncbo.cgsrvr.com/geoserver/ODT/wms?service=WMS&amp;amp;version=1.1.0&amp;amp;request=GetMap&amp;amp;layers=ODT:Chesapeake_Bay_Benthic_Habitat_CMECS_SGC_08_15_2012&amp;amp;styles=ODT_Benthic_Mddnr&amp;amp;bbox=321122.25769999996,4082994.0966,443060.8214000003,4366307.511000001&amp;amp;width=220&amp;amp;height=512&amp;amp;srs=EPSG:26918&amp;amp;format=application/openlayers"&gt;http://oyster.ncbo.cgsrvr.com/geoserver/ODT/wms?service=WMS&amp;amp;version=1.1.0&amp;amp;request=GetMap&amp;amp;layers=ODT:Chesapeake_Bay_Benthic_Habitat_CMECS_SGC_08_15_2012&amp;amp;styles=ODT_Benthic_Mddnr&amp;amp;bbox=321122.25769999996,4082994.0966,443060.8214000003,4366307.511000001&amp;amp;width=220&amp;amp;height=512&amp;amp;srs=EPSG:26918&amp;amp;format=application/openlayers&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 16:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333574#M30786</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2014-01-22T16:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333575#M30787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Brett,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have some JavaScript documentation about working with &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/wmslayer.html"&gt;WMS layers&lt;/A&gt;&lt;SPAN&gt;, and a couple of &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/#search/WMSLayer"&gt;samples&lt;/A&gt;&lt;SPAN&gt; that demonstrate the ability.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd say give these resources a shot and post back here if you run into any issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Noah&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333575#M30787</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2014-01-22T18:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333576#M30788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I worked with the samples and I'm still not able to make any progress.&amp;nbsp; I've already got the service added and it shows the specific layer, but there's a different styling of the layer that we're trying to use that I can't target specifically.&amp;nbsp; Here's my code to add the layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onLoad", function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmsLayer = new esri.layers.WMSLayer("http://oyster.ncbo.cgsrvr.com/geoserver/ODT/wms");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmsLayer.setVisibleLayers([3]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmsLayer.setImageFormat("format");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmsLayer.setOpacity(0.75);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(wmsLayer.layerInfos, function(layerInfo) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(layerInfo.title);
&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; map.addLayer(wmsLayer);
&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That brings up the layer I'm trying to work with but not the specific style that was created for us.&amp;nbsp; If you look at the original URL I gave, there's a part of the URL that specifies the style ("&amp;amp;styles=ODT_Benthic_Mddnr").&amp;nbsp; I want to get that to show up, but I don't know how (I even tried adding it in ArcMap but I can't do that either!).&amp;nbsp; The documentation doesn't make any mention of styles anywhere, so I'm not even sure this is possible via the JavaScript API.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:47:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333576#M30788</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2021-12-11T15:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333577#M30789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any answer for this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 12:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333577#M30789</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2014-01-28T12:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333578#M30790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still having a hard time figuring this out.&amp;nbsp; I can successfully add the WMS layer, but there doesn't appear to be any way to specify the style that will go in the request.&amp;nbsp; When I open up the map and look at the Net tab in Firebug, I can see it's sending a request out that says &lt;/SPAN&gt;&lt;A href="http://oyster.ncbo.cgsrvr.com/geoserver/ODT/ows?SERVICE=WMS&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE"&gt;http://oyster.ncbo.cgsrvr.com/geoserver/ODT/ows?SERVICE=WMS&amp;amp;SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&lt;/A&gt;&lt;STRONG&gt;&amp;amp;STYLES=&lt;/STRONG&gt;&lt;SPAN&gt;&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=Chesapeake_Bay_Benthic_Habitat_CMECS_SGC_08_15_2012&amp;amp;WIDTH=1920&amp;amp;HEIGHT=631&amp;amp;CRS=EPSG:3857&amp;amp;BBOX=-15605601.115580603,2895690.3121166304,-6213019.079900644,5982523.262384368.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I've bolded the section that says "&amp;amp;STYLES=", so I can see the parameter is included in the request, but I have no idea how to add a value to it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 17:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333578#M30790</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2014-02-21T17:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333579#M30791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like custom styles are not supported in ESRI's WMSLayer implementation, so your only option is likely to create a custom WMS Layer type that you can use instead.&amp;nbsp; This will allow you to manually set the STYLES parameter.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See this sample:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html"&gt;https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 20:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333579#M30791</guid>
      <dc:creator>JasonGreenlaw</dc:creator>
      <dc:date>2014-02-21T20:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333580#M30792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It looks like custom styles are not supported in ESRI's WMSLayer implementation, so your only option is likely to create a custom WMS Layer type that you can use instead.&amp;nbsp; This will allow you to manually set the STYLES parameter.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;See this sample:&amp;nbsp; &lt;A href="https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html"&gt;https://developers.arcgis.com/javascript/jssamples/layers_custom_wms.html&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&amp;nbsp; I tried messing with that and my result was strange.&amp;nbsp; I got the layer to show up on the map, but as a small, static image; when I would zoom in/out, the layer wouldn't reflect the zoom changes.&amp;nbsp; I copied all the parameters exactly as they were called from simply adding it as a regular WMS layer, but nothing seemed to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 12:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333580#M30792</guid>
      <dc:creator>BrettGreenfield__DNR_</dc:creator>
      <dc:date>2014-02-24T12:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a WMS layer with a customized style</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333581#M30793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="" style="color: #4d4d4d; background: linear-gradient(#c7c7c7, #e1e1e1, #fafafa); border-bottom: 1px solid #dddddd; margin: 0px 0px 0px -0.4em; padding: 0.2em 0.5em;"&gt;&lt;H4 class="" style="font-weight: 500; font-size: 1.0625em; margin: 0.2em 0px 0.4em;" id="toc-hId-1283048281"&gt;&amp;lt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" style="color: #00629b; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;Object&lt;/A&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;gt; customLayerParameters&lt;/H4&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #4d4d4d; background-color: #ffffff; padding: 0.5em 0.2em;"&gt;Use this to append different custom parameters to WMS layer requests. For example, if your WMS layer supports styles, styles can be used as a custom parameter for layer requests.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;The custom parameters are applied to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;GetMap&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;GetFeatureInfo&lt;/CODE&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;STRONG style="font-weight: bold;"&gt;NOTE:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;CODE&gt;customLayerParameters&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;can be part of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;resourceInfo&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or outside of it in the WMSLayer's constructor. If both are set in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;resourceInfo&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and also directly as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;customLayerParameters&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the constructor, the one in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;resourceInfo&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;takes precedence.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;(Added at v3.18)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #4d4d4d; background-color: #ffffff; padding: 0.2em 0px;"&gt;&lt;STRONG style="font-weight: bold;"&gt;Sample:&lt;/STRONG&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;"customLayerParameters"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt;
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;"styles"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;"pointsymbolizer"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt; 
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;"SLD"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;"https://.../point_pointSymbolizer.xml"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666600;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-wms-layer-with-a-customized-style/m-p/333581#M30793</guid>
      <dc:creator>AgostinoCirasa</dc:creator>
      <dc:date>2021-12-11T15:47:33Z</dc:date>
    </item>
  </channel>
</rss>

