<?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: Controlling layer visibility of a map service from code in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235209#M6046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Terry, this is what I was looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2011 13:31:29 GMT</pubDate>
    <dc:creator>PaulHuppé</dc:creator>
    <dc:date>2011-06-10T13:31:29Z</dc:date>
    <item>
      <title>Controlling layer visibility of a map service from code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235207#M6044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to control the layer visibility of a map service in code behind.&amp;nbsp; I thought this would be simple, but I am having a hard time getting this done. I can get a hold of the service from my Map Control, called map, using map.Layers[0] for example.&amp;nbsp; This contains an array of LayerInfo.&amp;nbsp; If I loop on this array, for any of the LayerInfo, there is no settable visibility property.&amp;nbsp; The LayerInfo only has a DefaultVisibility property which is a boolean indicating the layer's default visibility.&amp;nbsp; I also tried looking in the MapLegend control without success.&amp;nbsp; Is there an easy way to do this that I have not found yet?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 12:12:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235207#M6044</guid>
      <dc:creator>PaulHuppé</dc:creator>
      <dc:date>2011-06-10T12:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling layer visibility of a map service from code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235208#M6045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Assuming the layer you're after is of type ArcGISDynamicMapServiceLayer, use the VisibleLayers property to control which sublayers are displayed.&amp;nbsp; It's an array of Int so just add/remove the sublayer index from that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 int[] myVisibleLayers = { 1, 2, 4 };&amp;nbsp; //sublayers 0 &amp;amp; 3 will not display 
 myArcGISDynamicMapServiceLayer.VisibleLayers = myVisibleLayers;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:51:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235208#M6045</guid>
      <dc:creator>TerryGiles</dc:creator>
      <dc:date>2021-12-11T11:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling layer visibility of a map service from code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235209#M6046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Terry, this is what I was looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/controlling-layer-visibility-of-a-map-service-from/m-p/235209#M6046</guid>
      <dc:creator>PaulHuppé</dc:creator>
      <dc:date>2011-06-10T13:31:29Z</dc:date>
    </item>
  </channel>
</rss>

