Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

187639
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
Thank you very much for this toc manager, but I'm getting the following error:

1046: Type was not found or it is not compile-time constant: Tocitem
I'm getting this error when I declare a toc item input in a function

I'm using flash builder 4.0 (build 272416) and the latest flex viewer: 4.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
betbalence,

    there is no way in the compiled version to set the position of the details popup as it is hard coded to center on screen.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Khaled,

   Sounds like you have failed to import the reference for the TocItem.

import widgets.TOC.toc.tocClasses.TocItem;
0 Kudos
ConejeSapiens
Emerging Contributor
true... I have been looking in the code and I couldn't find it.

Thanks for your answer
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
bestbalence,


   The code where this happen is in the TocItemRenderer.as

        private function showMeta(evt:Event):void
        {
            if (data is TocItem) {
                var item:TocItem = TocItem(data);
                if(item.ttooltip && item.ttooltip != ""){
                    var mydetailswindow:DetailsWindow;
                    mydetailswindow = DetailsWindow(PopUpManager.createPopUp(ViewerContainer.getInstance().mapManager.map,DetailsWindow,false,PopUpManagerChildList.POPUP));
                    mydetailswindow.windowDetails = item.ttooltip;
                    mydetailswindow.iconDisplay.source = _Icon2;
                    mydetailswindow.detailsTitle = item.label;
                    PopUpManager.centerPopUp(mydetailswindow);
                }
            }
        }
0 Kudos
KhaledGh_
Emerging Contributor
Thanks for the reply, but I'm importing it to the mxml:

"import widgets.TOC.toc.tocClasses.TocItem;
import widgets.TOC.toc.tocClasses.TocItemRenderer;
import widgets.TOC.toc.tocClasses.TocLayerInfoItem;
import widgets.TOC.toc.tocClasses.TocMapLayerItem;"

How can i fix the problem?

Thanks again.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Khaled,

   You have to watch your CASE. You have Tocitem when is should be TocItem.
0 Kudos
KevinBraden
Emerging Contributor
Robert,

Hello.  New poster here, please bear with me...

I am using Flexviewer 2.4.  When I toggle the TOC, the TOC seems to be exhbiting random behavior in that sometimes the layers are fully collapsed to the top-most level or (in other cases) the layer is expanded to other level or levels.  

I would like to show all levels fully collapsed to the the top-most level.  I tried to create the service for each layer with the Arcmap layers fully collapsed and unselected, but that did nothing. 

I also set the  <collapselegends> tag in the TOC widget to "true", but this did nothing. 

How do I achieve this layout of the TOC so that each layer is collapsed?  Is this a setting in the mxml for the TOC that I need to modify through code? 

Also, how does one load the TOC such that the initial extent (length, width) of the TOC cleanly displays all of the layers?

Many thanks in advance for any advice that you can supply.

-Kevin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,

  The way to have all the toc items collapsed to their top level is to use the :

<expanded>false</expanded>


I have never seem the random behavior you are describing and have had no one else report it. I also am unable to reproduce it so far...

To set the widgets height and width all you do is all those attributes to the widget in the main config.xml

<widget label="Map Contents" x="75" y="100" width="440" height="700"
                preload="open"
                icon="assets/images/i_folder.png"
                config="widgets/TOC/TOCWidget.xml"
                url="widgets/TOC/TOCWidget.swf"/>
0 Kudos
KevinBraden
Emerging Contributor
Robert,

Thank you so much.  That did the trick.

Kind regards,

-Kevin
0 Kudos