<?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: URL Parameters and Layer Visibility in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541176#M15334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Begin by looking here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#visibleLayers"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#visibleLayers&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 16:01:55 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2011-06-07T16:01:55Z</dc:date>
    <item>
      <title>URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541175#M15333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Everyone, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been avoiding this problem for a while now, and my list is now empty enough that I had to start working on it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get a URL Parameter to activate a layer, based on the layer name (!), in order to complete functionality for an atlas (links from an html page must open the map viewer with certain layers turned on). Preferably I would like to be able to turn on Groups as well as individual layers (if the url parameter == the name of a group, turn all of that group on.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone implemented something along these lines? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I understand, 2.3.1 changed the way URL parameters are parsed, no longer using the mapLoadComplete function, which many posts state;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Current investigation has lead to ConfigManager.as containing the current URL parameter parser for itemid, center (scale etc). Another ViewerContainer.urlConfigParams.[tag] would catch new [tag] parameters (i.e. ../index.html?layer=Search%20This would catch "Search This"). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Toggling map services is one thing, but how does one change the visibility of a layer within a map service, I'm still a little unclear on this... How to toggle the visibility of a layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This all seems a little overwhelming, and I get the feeling that this is not a simple feat. Some guidance would be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 15:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541175#M15333</guid>
      <dc:creator>JustinRobinson</dc:creator>
      <dc:date>2011-06-07T15:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541176#M15334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Begin by looking here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#visibleLayers"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#visibleLayers&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 16:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541176#M15334</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-06-07T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541177#M15335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, well that was a long day. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a working widget now that can do what I need, once again, a lot of work for a simple solution. However, now I've got an issue. I can get the layer turned on from a map service just fine, now I just need to have the Table of Contents update. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I think I need Roberts help. I'm using your TOC Widget v. 2.3.3 and I was wondering if there was an event (?) I could dispatch that would cause the TOC widget to re-initialize and redetermine layer visibility... is this possible, or will I have to modify the TOC Widget for this purpose?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 21:43:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541177#M15335</guid>
      <dc:creator>JustinRobinson</dc:creator>
      <dc:date>2011-06-07T21:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541178#M15336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ended up integrating the url call into your TOC Widget so that I could access some of its features, I'm not sure if this is the right idea or not, but it's semi-working. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I call a function (shown below) during the init() function that checks for URL parameters, and if it finds one enables that layer. This is fine, it also toggles the checkbox of that layer (which wasn't happening when the function was in its own widget). The problem is now toggling the checkbox of the parents/children of that layer. I'm not sure how to get access to this... recommendations?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the function that is called:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function URLLayer():void //Is there anything to turn on from URL Function
{
 if (ViewerContainer.urlConfigParams.service + ViewerContainer.urlConfigParams.layer) {
&amp;nbsp; var layerIDNum:Number;
&amp;nbsp; var service:Layer = map.getLayer(ViewerContainer.urlConfigParams.service);
&amp;nbsp; var visibleLayers:ArrayCollection = ArcGISDynamicMapServiceLayer(service).visibleLayers;
&amp;nbsp; 
&amp;nbsp; var layerInfos:Array = ArcGISDynamicMapServiceLayer(service).layerInfos;
&amp;nbsp; 
&amp;nbsp; for each (var item:LayerInfo in layerInfos){
&amp;nbsp;&amp;nbsp; if (item.name == ViewerContainer.urlConfigParams.layer){
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerIDNum = item.id;
&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; visibleLayers.addItem(layerIDNum); 
&amp;nbsp; 
 }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for all your help and input Robert (not just here or for me, but across the forum and its archive), if it wasn't for you I think many of our applications would be severely limited...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541178#M15336</guid>
      <dc:creator>JustinRobinson</dc:creator>
      <dc:date>2021-12-11T23:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541179#M15337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Here is the code needed to have the TOC update when a visibleLayers property is changed problematically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code to add to the TocMapLayerItem.as&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Add this new import
import mx.binding.utils.ChangeWatcher;

//Change this code in the createChildren function
&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 ArcGISTiledMapServiceLayer)
&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; layerInfos = ArcGISTiledMapServiceLayer(layer).layerInfos;
&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;SPAN style="color:Red;"&gt;ChangeWatcher.watch(ArcGISTiledMapServiceLayer(layer), "visibleLayers", updateVisibilty);
&lt;/SPAN&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; else if (layer is ArcGISDynamicMapServiceLayer)
&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; layerInfos = ArcGISDynamicMapServiceLayer(layer).layerInfos;
&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 (ArcGISDynamicMapServiceLayer(layer).visibleLayers)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayers = ArcGISDynamicMapServiceLayer(layer).visibleLayers.toArray();
&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;SPAN style="color:Red;"&gt;ChangeWatcher.watch(ArcGISDynamicMapServiceLayer(layer), "visibleLayers", updateVisibilty);&lt;/SPAN&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

//Add this new function:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function updateVisibilty(evt:Event):void
&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 visibleLayers:Array;
&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)
&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; visibleLayers = ArcGISDynamicMapServiceLayer(layer).visibleLayers.toArray();
&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; else if (layer is ArcIMSMapServiceLayer)
&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; visibleLayers = ArcIMSMapServiceLayer(layer).visibleLayers.toArray();
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each (var child:TocItem in children)
&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; if(child is TocLayerInfoItem){
&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 tli:TocLayerInfoItem = child as TocLayerInfoItem;
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(visibleLayers.indexOf(tli.layerInfo.id) &amp;gt; -1){
&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; child.setVisible(true, true);
&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; }else{
&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; child.setVisible(false, true);
&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;&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; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this working in my TOC on my development machine. I just don't know if it will work at startup.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541179#M15337</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T23:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541180#M15338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Robert,&lt;BR /&gt;&lt;BR /&gt;I ended up integrating the url call into your TOC Widget so that I could access some of its features, I'm not sure if this is the right idea or not, but it's semi-working. &lt;BR /&gt;&lt;BR /&gt;I call a function (shown below) during the init() function that checks for URL parameters, and if it finds one enables that layer. This is fine, it also toggles the checkbox of that layer (which wasn't happening when the function was in its own widget). The problem is now toggling the checkbox of the parents/children of that layer. I'm not sure how to get access to this... recommendations?&lt;BR /&gt;&lt;BR /&gt;Here is the function that is called:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function URLLayer():void //Is there anything to turn on from URL Function
{
 if (ViewerContainer.urlConfigParams.service + ViewerContainer.urlConfigParams.layer) {
&amp;nbsp; var layerIDNum:Number;
&amp;nbsp; var service:Layer = map.getLayer(ViewerContainer.urlConfigParams.service);
&amp;nbsp; var visibleLayers:ArrayCollection = ArcGISDynamicMapServiceLayer(service).visibleLayers;
&amp;nbsp; 
&amp;nbsp; var layerInfos:Array = ArcGISDynamicMapServiceLayer(service).layerInfos;
&amp;nbsp; 
&amp;nbsp; for each (var item:LayerInfo in layerInfos){
&amp;nbsp;&amp;nbsp; if (item.name == ViewerContainer.urlConfigParams.layer){
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerIDNum = item.id;
&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; visibleLayers.addItem(layerIDNum); 
&amp;nbsp; 
 }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for all your help and input Robert (not just here or for me, but across the forum and its archive), if it wasn't for you I think many of our applications would be severely limited...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you tell us more information how you passed the URL parameters into this URLLayer() function? Can you post how you populate the ViewerContainer.urlConfigParams.service and ViewerContainer.urlConfigParams.layer variables? Did you add some stuff somewhere in the ViewerContainer setUrlConfigParams() function?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:28:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541180#M15338</guid>
      <dc:creator>GISDev1</dc:creator>
      <dc:date>2021-12-11T23:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541181#M15339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello Everyone, &lt;BR /&gt;&lt;BR /&gt;I am trying to get a URL Parameter to activate a layer, based on the layer name (!), in order to complete functionality for an atlas (links from an html page must open the map viewer with certain layers turned on). Preferably I would like to be able to turn on Groups as well as individual layers (if the url parameter == the name of a group, turn all of that group on.)&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, is the URL "dynamic" meaning that they are "assigned" by code when someone clicks the link from the html page, or are they hard coded links?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a little different than you asked for, but if the link is hard coded, a different approach would be to have a different config file within the same FV app for each link.&amp;nbsp; then, the URL would pass the config.xml file with the layers/groups that "should" be turned on set as visible="true", and your are done.&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://server.com/flexviewer/?config=URLconfig1.xml"&gt;http://server.com/flexviewer/?config=URLconfig1.xml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 00:34:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541181#M15339</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-07-03T00:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: URL Parameters and Layer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541182#M15340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So, is the URL "dynamic" meaning that they are "assigned" by code when someone clicks the link from the html page, or are they hard coded links?&lt;BR /&gt;&lt;BR /&gt;This is a little different than you asked for, but if the link is hard coded, a different approach would be to have a different config file within the same FV app for each link.&amp;nbsp; then, the URL would pass the config.xml file with the layers/groups that "should" be turned on set as visible="true", and your are done.&amp;nbsp; &lt;A href="http://server.com/flexviewer/?config=URLconfig1.xml"&gt;http://server.com/flexviewer/?config=URLconfig1.xml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;R_&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a good way to do it for some workflows. In my case, the URL is created dynamically, so a config would be needed for every single layer combination on and off to do it this way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 11:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/url-parameters-and-layer-visibility/m-p/541182#M15340</guid>
      <dc:creator>GISDev1</dc:creator>
      <dc:date>2013-07-03T11:31:58Z</dc:date>
    </item>
  </channel>
</rss>

