<?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 Failed to add an operational layer. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485440#M45196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I created a mayservice (containing only 1 layer) a couple of days ago, and I could add it as a operational layer by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer(serverURL, { "opacity": 0.5 } );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayers([basemap, operationalLayer, featureLayer]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After I updated the mapservice to hold multiple layers.&amp;nbsp; Then I revised the code as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer(serverURL + "/0", { "opacity": 0.5 } );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where the '/0' points to the layer to be added.&amp;nbsp; However, in this way, the operational layer is not added or displayed.&amp;nbsp; What's wrong I did here?&amp;nbsp; Thanks if you can point out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jan 2014 16:08:35 GMT</pubDate>
    <dc:creator>ShaningYu</dc:creator>
    <dc:date>2014-01-24T16:08:35Z</dc:date>
    <item>
      <title>Failed to add an operational layer.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485440#M45196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I created a mayservice (containing only 1 layer) a couple of days ago, and I could add it as a operational layer by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer(serverURL, { "opacity": 0.5 } );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayers([basemap, operationalLayer, featureLayer]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After I updated the mapservice to hold multiple layers.&amp;nbsp; Then I revised the code as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer(serverURL + "/0", { "opacity": 0.5 } );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where the '/0' points to the layer to be added.&amp;nbsp; However, in this way, the operational layer is not added or displayed.&amp;nbsp; What's wrong I did here?&amp;nbsp; Thanks if you can point out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:08:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485440#M45196</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2014-01-24T16:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add an operational layer.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485441#M45197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To show some of the layers for a ArcGISDynamicMapServiceLayer, you have to use the setVisibleLayers method. Using the "/0" at the end of the URL is for FeatureLayers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer(serverURL, { "opacity": 0.5 } ); operationalLayer.setVisibleLayers([0]);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485441#M45197</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-01-24T16:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add an operational layer.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485442#M45198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;kenbuja:&amp;nbsp; Thanks for your response.&amp;nbsp; Your answer has been credited.&amp;nbsp; However, I also got another solution by loading the TOC component sourced from &lt;/SPAN&gt;&lt;A href="http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/examples/toc.html"&gt;http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/examples/toc.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:59:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485442#M45198</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2014-01-24T16:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add an operational layer.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485443#M45199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The TOC is a remarkable tool and I salute NLui for developing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when using Dynamic Layers, you'll always have to set the visible layers somehow, either with setVisibleLayers or a tool like this. If you delve into the code for NLui's TOC or Matt Driscoll's &lt;/SPAN&gt;&lt;A href="https://github.com/driskull/arcgis-dijit-layer-legend-js"&gt;Layer Legend Widget&lt;/A&gt;&lt;SPAN&gt;, you'll see that they use setVisibleLayers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 17:48:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/failed-to-add-an-operational-layer/m-p/485443#M45199</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-01-24T17:48:41Z</dc:date>
    </item>
  </channel>
</rss>

