Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

183314
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
RobertScheitlin__GISP
MVP Emeritus
Frank,

Have you tried to change the width of the WidgetTemplate in the TOCWidget.mxml?

<viewer:WidgetTemplate id="wTemplate"
                           height="300"
                           skinClass="com.esri.viewer.skins.WidgetTemplateSkin"
                           width="440">
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Frank,

  Try this instead:

        override protected function measure():void
        {
            super.measure();
            const tocItem:TocItem = TocItem(data);
    
            // Add space for the checkbox and gaps
            if (isNaN(explicitWidth) && !isNaN(measuredWidth))
            {
                var w:Number = measuredWidth;
                if(tocItem)
                    if(w < tocItem.tocMinWidth)
                        w = tocItem.tocMinWidth - 20;
                if (_vbox && _vbox.numChildren > 0 && _vbox.measuredWidth > w) w = _vbox.measuredWidth;
                measuredWidth = w;
            }
            if (!isNaN(measuredHeight))
            {
                var h:Number = measuredHeight + 5;
                if(_vbox && _vbox.numChildren > 0) h += _vbox.getExplicitOrMeasuredHeight();
                measuredHeight = h;
            }
        }
0 Kudos
DanielMunoz
Regular Contributor
Robert,


Thank you very much for the information on the tooltip, It works now but only with the map service but not with the individual layers, I'm going to assume it's because I'm using *.msd instead of *.mxd and shapefiles instead of sde layers. I'm going to try with others services, thanks again.

Daniel
0 Kudos
FrankRoberts
Frequent Contributor
Robert the above code seemed to do the trick!

Thanks!
Frank
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   The changes that Frank and I tested are now compiled into version 2.3.8.2 as well as more code and layout optimization.
0 Kudos
EricVenden
Frequent Contributor
Has anyone experienced the following:

I have removed some layers from display in the latest TOC widget(2.3.8.1).  Many of these layers are annotation - with annotation classes.  If I click on a group in the TOC that has some layers removed to expand it and then click again to retract it, the Flash plug-in crashes.

Thanks
Eric V
Gurnee, IL
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   By that you mean that you added several map service sublayer ids to the excludelayers element in the xml right?
0 Kudos
EricVenden
Frequent Contributor
Eric,

   By that you mean that you added several map service sublayer ids to the excludelayers element in the xml right?


Correct - like this:

<excludelayers>
  <excludelayer mapservice="Basemap">0</excludelayer>
  <excludelayer mapservice="Basemap">6</excludelayer>
  <excludelayer mapservice="Basemap">7</excludelayer>
  <excludelayer mapservice="Basemap">8</excludelayer>
  <excludelayer mapservice="Basemap">9</excludelayer>
  <excludelayer mapservice="Basemap">10</excludelayer>
  <excludelayer mapservice="Basemap">11</excludelayer>
  <excludelayer mapservice="Basemap">12</excludelayer>
         </excludelayers>
0 Kudos
EricVenden
Frequent Contributor
Robert,
I have attached an image of the REST service(REST.jpg).  I am attempting to remove id's 1-10 and only allow the user to turn the "overall" group on/off.  When I include layers 1- 10, I get the attached result (TOC_after.jpg).  The original "state" of the TOC is the attached TOC_before.jpg

I understand if this widget is not intended to perform this type of operation.
Thanks for your time.
Eric V
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

  Thanks for the helpful info. I now have the issue resolved in version 2.3.8.3.
Also in your case you can optimize the xml by limiting to one line:

<excludelayer mapservice="Basemap">0,6,7,8,9,10,11,12</excludelayer>
0 Kudos