<?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: TOC Scale Dependency, not SFV in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322576#M7699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried your code however, if the layer loading takes time, the scale dependency code falls apart and doesn't work. For example, it works for layer upto a layer that's slow in loading but then fails on the layer that takes time to load. It then also affects all layer below the slow loading layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Jan 2011 07:18:28 GMT</pubDate>
    <dc:creator>FaizanTayyab</dc:creator>
    <dc:date>2011-01-28T07:18:28Z</dc:date>
    <item>
      <title>TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322569#M7692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I started out using Tom Hill's code for the TOC, and love it, but I really needed to be able to see scale dependency.&amp;nbsp; I found a lot of threads pertaining to the sample flex viewer and love Robert Scheitlin's implementation on his site for the Sample Flex Viewer.&amp;nbsp; Robert posted a version that supposedly works on for those of us that started out with Tom Hill's code, but it isn't quite working for me.&amp;nbsp; I can see the scalebar overlay on some of the scale dependent layers, but it's not obeying all of the rules for extent changes and layer toggling.&amp;nbsp; I can go into more detail if someone can help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code I am using was posted here by Robert:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2421&amp;amp;t=295625&amp;amp;mc=1"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2421&amp;amp;t=295625&amp;amp;mc=1&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone out there had any issues with this code, did you eventually get it working, and if so, how?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 21:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322569#M7692</guid>
      <dc:creator>MelonyBarrett</dc:creator>
      <dc:date>2010-06-16T21:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322570#M7693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Melony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Are you having issues with layer that have a minscale and maxscale defined? I have seen this issue and have a fix for it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 00:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322570#M7693</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-06-17T00:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322571#M7694</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'm not sure.&amp;nbsp; I'm not quite clear on the minscale maxscale thing.&amp;nbsp; Do I set that somewhere in the code or is it from the .mxd?&amp;nbsp; In my case, the scale dependency is set in the .mxd.&amp;nbsp; And yes, as far as I can tell these are the layers that are behaving badly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 14:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322571#M7694</guid>
      <dc:creator>MelonyBarrett</dc:creator>
      <dc:date>2010-06-17T14:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322572#M7695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Melony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; It is all controlled by the MXD. If you make changes to the min or max scale in the MXD you will have to republish and clear your REST cache before you will see the changes in the TOC though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 14:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322572#M7695</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-06-17T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322573#M7696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, Robert, I may have gotten somewhere!&amp;nbsp; When I zoom in beyond the maximum scale, it is properly reflected in the TOC, however, when I zoom out beyond the minimum scale, the sd_overlay is not shown.&amp;nbsp; So, the scale dependent code is halfway to working perfectly.&amp;nbsp; Is this the issue you referred to knowing the fix for?!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got my fingers crossed!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for your time!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 23:15:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322573#M7696</guid>
      <dc:creator>MelonyBarrett</dc:creator>
      <dc:date>2010-06-17T23:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322574#M7697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Melony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Yep, I think that you are having the issue I have fixed in the attached code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TocLayerInfoItem.as&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;////////////////////////////////////////////////////////////////////////////////
//
// Copyright © 2008 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.&amp;nbsp; See use restrictions in the file:
// &amp;lt;install location&amp;gt;/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////

package com.esri.solutions.flexviewer.components.toc.tocClasses
{
 
 import com.esri.ags.events.ExtentEvent;
 import com.esri.ags.layers.LayerInfo;
 import com.esri.solutions.flexviewer.SiteContainer;
 
 /**
&amp;nbsp; * A TOC item representing a member layer of an ArcGIS or ArcIMS map service.
&amp;nbsp; * This includes group layers that contain other member layers.
&amp;nbsp; */
 public class TocLayerInfoItem extends TocItem
 {
&amp;nbsp; public function TocLayerInfoItem( parentItem:TocItem, layerInfo:LayerInfo)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; super(parentItem);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; _layerInfo = layerInfo;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; label = layerInfo.name;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; // Set the initial visibility without causing a layer refresh
&amp;nbsp;&amp;nbsp; setVisible(layerInfo.defaultVisibility, false);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; SiteContainer.getInstance().controller.map.addEventListener(ExtentEvent.EXTENT_CHANGE,checkExtent);
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; internal static const DEFAULT_MAX:Number = 0;
&amp;nbsp; 
&amp;nbsp; private var _maxScale:Number = DEFAULT_MAX;
&amp;nbsp; 
&amp;nbsp; public function set maxScale( value:Number ):void
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; _maxScale = value;
&amp;nbsp;&amp;nbsp; this.scaledependant = true;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; if(_maxScale &amp;gt; 0 &amp;amp;&amp;amp; _minScale &amp;gt; 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale) &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; (SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; } else if (_maxScale &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else if (_minScale &amp;gt; 0 ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; public function get maxScale():Number
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return _maxScale;
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; private function checkExtent(evt:ExtentEvent):void{
&amp;nbsp;&amp;nbsp; this.scaledependant = true;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; if(_maxScale &amp;gt; 0 &amp;amp;&amp;amp; _minScale &amp;gt; 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale) &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; (SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; } else if (_maxScale &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else if (_minScale &amp;gt; 0 ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; internal static const DEFAULT_MIN:Number = 0;
&amp;nbsp; 
&amp;nbsp; private var _minScale:Number = DEFAULT_MIN;
&amp;nbsp; 
&amp;nbsp; public function set minScale( value:Number ):void
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; _minScale = value;
&amp;nbsp;&amp;nbsp; this.scaledependant = true;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; if(_maxScale &amp;gt; 0 &amp;amp;&amp;amp; _minScale &amp;gt; 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale) &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; (SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; } else if (_maxScale &amp;gt; 0 ){
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;gt;= _maxScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else if (_minScale &amp;gt; 0 ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((SiteContainer.getInstance().controller.map.scale &amp;lt;= _minScale)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.scaledependant = false;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; public function get minScale():Number
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return _minScale;
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; //--------------------------------------------------------------------------
&amp;nbsp; //&amp;nbsp; Property:&amp;nbsp; layerInfo
&amp;nbsp; //--------------------------------------------------------------------------
&amp;nbsp; 
&amp;nbsp; private var _layerInfo:LayerInfo;
&amp;nbsp; 
&amp;nbsp; /**
&amp;nbsp;&amp;nbsp; * The map layer info that backs this TOC item.
&amp;nbsp;&amp;nbsp; */
&amp;nbsp; public function get layerInfo():LayerInfo
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return _layerInfo;
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; //--------------------------------------------------------------------------
&amp;nbsp; //
&amp;nbsp; //&amp;nbsp; Methods
&amp;nbsp; //
&amp;nbsp; //--------------------------------------------------------------------------
&amp;nbsp; 
&amp;nbsp; /**
&amp;nbsp;&amp;nbsp; * @private
&amp;nbsp;&amp;nbsp; */
&amp;nbsp; override internal function setVisible( value:Boolean, layerRefresh:Boolean = true ):void
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; // Set the visible state of all children, but defer the layer refresh
&amp;nbsp;&amp;nbsp; for each (var item:TocItem in children) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; item.setVisible(value, false);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; // Set the visible state of this item, but defer the layer refresh
&amp;nbsp;&amp;nbsp; super.setVisible(value, false);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; // Allow the layer refresh now that all changes have been made
&amp;nbsp;&amp;nbsp; if (layerRefresh) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; refreshLayer();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322574#M7697</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322575#M7698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, it took me so long to get back to you.&amp;nbsp; With your edits, it works!&amp;nbsp; Yay!&amp;nbsp; Thanks so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2010 15:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322575#M7698</guid>
      <dc:creator>MelonyBarrett</dc:creator>
      <dc:date>2010-06-22T15:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: TOC Scale Dependency, not SFV</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322576#M7699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried your code however, if the layer loading takes time, the scale dependency code falls apart and doesn't work. For example, it works for layer upto a layer that's slow in loading but then fails on the layer that takes time to load. It then also affects all layer below the slow loading layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jan 2011 07:18:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/toc-scale-dependency-not-sfv/m-p/322576#M7699</guid>
      <dc:creator>FaizanTayyab</dc:creator>
      <dc:date>2011-01-28T07:18:28Z</dc:date>
    </item>
  </channel>
</rss>

