Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

187722
664
12-01-2010 07:30 AM
RobertScheitlin__GISP
MVP Emeritus
All,

Here is the next in my line of widgets for the FlexViewer 2.x.

The legend portion of this widget is the same code as my dynamic legend widget so,

IT IS FOR ARCGIS SERVER 10 OR GREATER ONLY

This is just a simple TOC Widget that includes my dynamic legend component.
This widget also includes my enhancement for map service transparency,
right click context menu for zoom to make layer visible, and my scale
dependent renderer for the TOC checkboxes.
Tags (2)
0 Kudos
664 Replies
KhaledGh_
Emerging Contributor
Thanks but I rechecked my case and I'm using TocItem in the code and I'm importing widgets.TOC.toc.tocClasses.TocItem;
Both are capital (I)s. May it be some components missing in my code.
I really appreciate your help.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Khaled,

   I don't have any other suggestions for this error:
1046: Type was not found or it is not compile-time constant: Tocitem
0 Kudos
KhaledGh_
Emerging Contributor
Thanks very much for your help; I'll recheck it and reply if I found any solution.

Edit: It worked; I had the name of the package as TOCWidget instead of TOC; I renamed it to TOC and worked smoothly.
It's a very good and nice tool.
0 Kudos
SaugatJoshi
Deactivated User
Hi Robert,

Is there a way we could simply hide the layer names in TOC so that it does not appear. I have a string of booleans coming from java (1,0,1,0,0....) which matches the layer order structure in map service. The string keeps changing depending on different views user can choose (Views are basically extent) fromm a drop down. Each view has its own set of mandatory layers to be on/off. I was able to get the different layers on/off with views.
When I have 1 I use
      if (Arr=="1")
      {
       itm1.children.visible=true; 
                                                                  k=k+1;                                //For Group Layers
        
      }

and

                                    if (Arr=="1")
       { 
                                            itm1.children.children.visible= true;
                                                             k=k+1;               //For SubLayers in group 
       }


With the 0s I simply do not want them to appear on the TOC. How can I achieve this. I simply want to hide them and exclude from the TOC without using excludelayer property.  Can some display property make this invisible.

Thanks.
0 Kudos
ScottKiley
Frequent Contributor
My FlexViewer application is not fully honoring the ExludeLayer list in the TOC.xml configuration.  I list layer numbers to exclude map service sub-layers.  They are not loaded into the TOC, so the TOC is created properly, but when turning a layer on, or back on after it is turned off, all layers turned on, even the excluded layers.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   That is actually the desired behavior of many users. If you want to eliminate those layers from the map than you have to use a layer definition.
0 Kudos
ConejeSapiens
Emerging Contributor
Thanks for your answer :D, robert
0 Kudos
MLowry
by
Frequent Contributor
Hi Robert,

By going here: http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-toc.xml
And firstly clicking on the plus sign to the left of "Parcel Data" in the widget. A small pop-up shows up with the text, "Show Details". This only occurs on the top layer in the Table of contents.

Any way I can fix this or stop it from popping up?

Thanks for all of your great widgets; I use them all the time.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
This bug will be fixed in the 2.5 version of this widget coming soon.
0 Kudos
ScottKiley
Frequent Contributor
Robert, I must be missing the intention of listing sub layer numbers in the excludelayer tag of the TOCWidget configuration file.  Please explain why you would want to limit layers of a map service in the TOC, but then not have that be honored when actually using the TOC to turn layers on and off.

To save server resources, I cannot make a map service for every application I create.  So, I repeatedly use map services for many different applications.  I need some way to limit the display of map services to specific layers.  I have used the visiblelayers attribute of the layers tag in the past, and removed code to expand and collapse the tree in the TOC widget (essentially to mask the unnecesarry layers).  I assumed you adding the ability to do this in the Widget configuration file met my needs.

Also, are you talking about using the definitionexpression tag when you refer to "a layer definition."?  Because having one exhibits the same behavior.  All layers of the map service still turn on.

Thank you for sharing all your work and knowledge.


Scott,

   That is actually the desired behavior of many users. If you want to eliminate those layers from the map than you have to use a layer definition.
0 Kudos