<?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: Determine which operational layers are visible in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591341#M13246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Anthony.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will review your code and try things at my end. I am a bit concerned though since my config doesn't define any Dynamic Map Service Layers with sub-layers, rather just Feature layers one after the other with no grouping. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14157378121092668 jive_text_macro" jivemacro_uid="_14157378121092668"&gt;
&lt;P&gt;&amp;lt;operationallayers coordSystemID="102187" coordSystemName="NAD_1983_3TM_114"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Location - ATS" type="feature" visible="true"&amp;nbsp; alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/0" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="True" constraintType="Geog" constraintSubType="Provincial" fieldAttribute1="TWP" fieldAttribute2="SC"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Airport Base" type="feature" visible="true"&amp;nbsp; alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/2" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/2&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="False" constraintType="" constraintSubType="" fieldAttribute1="" fieldAttribute2=""/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Assessment Area" type="feature" visible="true" alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/8" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/8&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="True" constraintType="System" constraintSubType="Test" fieldAttribute1="AssessArea" fieldAttribute2="AssessArea"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/operationallayers&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, in case I wasn't clear in original post, I need the current state and not the state as specified in the config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2014 20:31:57 GMT</pubDate>
    <dc:creator>RobertParis</dc:creator>
    <dc:date>2014-11-11T20:31:57Z</dc:date>
    <item>
      <title>Determine which operational layers are visible</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591339#M13244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running a FlexViewer 3.6 which contains a number of operational feature layers. The user is able to turn operational layers on or off using the built in More... button and clicking on or off the appropriate checkbox next to each layer name. I have a custom widget that needs to be able to determine whether an operational layer is Checked On or Off. I have searched all over the place and have realized it the answer is within the viewer and not the map service since I need to current state based on user interaction and not the configured state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the answer lies in TOC Items but would appreciate any assistance in simplifying this for more. Ultimately an array with the layer id or label and a bit for visible or not is what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 18:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591339#M13244</guid>
      <dc:creator>RobertParis</dc:creator>
      <dc:date>2014-11-11T18:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determine which operational layers are visible</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591340#M13245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is any function built into the code that allows you to determine this. I ran into the same problem over a year ago when I was trying to write a widget that saved the current state of the viewer. In the end I had to write some code that looped through all the dynamic map services then checked which layers in each were visible. The code sample is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14157352087312640" jivemacro_uid="_14157352087312640"&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;var acVisLayers:ArrayCollection = new ArrayCollection();&lt;/P&gt;&lt;P&gt;for each (var layer:Layer in map.layers)&lt;/P&gt;&lt;P&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;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layVisAc:ArrayCollection;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (layer is ArcGISDynamicMapServiceLayer)&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layVisAc = ArcGISDynamicMapServiceLayer(layer).visibleLayers as ArrayCollection;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var lvisObj:Object = {name: layer.name,visible: layer.visible,visarray: layVisAc};&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acVisLayers.addItem(lvisObj);&lt;/P&gt;&lt;P&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 19:43:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591340#M13245</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-11-11T19:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Determine which operational layers are visible</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591341#M13246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Anthony.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will review your code and try things at my end. I am a bit concerned though since my config doesn't define any Dynamic Map Service Layers with sub-layers, rather just Feature layers one after the other with no grouping. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14157378121092668 jive_text_macro" jivemacro_uid="_14157378121092668"&gt;
&lt;P&gt;&amp;lt;operationallayers coordSystemID="102187" coordSystemName="NAD_1983_3TM_114"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Location - ATS" type="feature" visible="true"&amp;nbsp; alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/0" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="True" constraintType="Geog" constraintSubType="Provincial" fieldAttribute1="TWP" fieldAttribute2="SC"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Airport Base" type="feature" visible="true"&amp;nbsp; alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/2" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/2&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="False" constraintType="" constraintSubType="" fieldAttribute1="" fieldAttribute2=""/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;layer label="Assessment Area" type="feature" visible="true" alpha="1"&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/8" rel="nofollow" target="_blank"&gt;http://server.com/arcgis/rest/services/XYZ/XYZ_ABCD/MapServer/8&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; assess="True" constraintType="System" constraintSubType="Test" fieldAttribute1="AssessArea" fieldAttribute2="AssessArea"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/operationallayers&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, in case I wasn't clear in original post, I need the current state and not the state as specified in the config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 20:31:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591341#M13246</guid>
      <dc:creator>RobertParis</dc:creator>
      <dc:date>2014-11-11T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Determine which operational layers are visible</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591342#M13247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have a look at this post to see if any of the code can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A href="https://community.esri.com/message/407209"&gt;Save layer visibility preferences - flex code question&lt;/A&gt;‌&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Anthony&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/determine-which-operational-layers-are-visible/m-p/591342#M13247</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-11-11T22:15:18Z</dc:date>
    </item>
  </channel>
</rss>

