Table of Contents - Legend Widget for FlexViewer 2.x

98991
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
Robert,

Thanks for this script and all the others - they are all very useful.

I've searched through the files looking for a way to get feature layers to list after the dynamic layers - can you direct me to the file(s) where this is rendered. I've messed around in TocMapLayerItem.as reordering places where FeatureLayers are processed after ArcGISDynamicMapServiceLayers, but I'm grasping at straws and while I haven't broke anything, it hasn't changed the output with Feature layers always being listed on top of Dynamic layers regardless of their order in the config.xml.

Thanks,
Jim


Jim,

   I see the issue in the code and have it fixed in version 2.5.0.1. Give it a try.
0 Kudos
JimBranch
New Contributor II
Thank you very much!!  Works like a charm. 

At some point ESRI needs to compensate you for all your widget enhancements - they really take the flex viewer to the next level.

-Jim
0 Kudos
AllisonShaw
New Contributor III
Hi Robert,

Some of the external map services I rely on are not running ArcGIS Server 10 so as per your documentation, I am still using version 2.4.0 of your TOC widget.  Sorry, I would love to upgrade otherwise!  Possibly because these services aren't using ArcGIS Server 10, the "Show Description" button does not appear for these services, only for my internal services.  I'm wondering (a) if anything can be done about this, and (b) if not, could I somehow set up a work-around where the button links to a pop-up I populate myself instead of the ArcGIS Manager Map Service Description.  Is this something that you could help me with?

Thanks so much,
Allison
0 Kudos
KeithGerhartz1
Occasional Contributor II
Robert,

I am setting sublayer visibility programatically in another widget and would like to know how to update the TOC. I have looked all over the Forum and found some older posts that seem relevant but have not been able to make it happen. I am thinking that things have changed quite a bit since these older posts and was wondering if you could comment?

Thank you.

Keith
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Keith,

   Currently the TOC Widget does not update to programmatic layer visiblilty changes. When  ever I get this figured out an updated version will be released.
0 Kudos
KennethLyons
New Contributor
I've started using the TOC widget more now that I've been able to upgrade to 2.5 and have had no issues implementing it.  I left a comment on the page before I saw the link to this thread. My problem at this point is that the "checks" in the "checkboxes" are showing up the same color which has made it difficult to tell when a layer is activated or not.  Can someone tell me where to locate where the "checks" are referenced so that I can change the color?

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kenneth,

   Sure you need to look in:

src/widgets/TOC/toc/controls/CheckBoxScaleDependant.as

        public function CheckBoxScaleDependant()
        {
            setStyle("icon", CheckBoxScaleDependantIcon);
            setStyle("checked", this.selected);
            setStyle("scaledependant", _scaledependant);
            setStyle("themeColor", FlexGlobals.topLevelApplication.getStyle("accentColor"));
            setStyle("iconColor", FlexGlobals.topLevelApplication.getStyle("accentColor"));
        }


Don't forget to click the top arrow (promote) on this post as shown below:
0 Kudos
KennethLyons
New Contributor
Robert,

Thank you, That did the trick.  I never would have thought to look in that .as file to change that.

My next issue is that I recently added a new coordinate widget to my viewer that incorporates grid and lat/long lines.  Is there anyway to not have them show up in the TOC.  this is what I have tried so far:
<excludelayers>
  <excludelayer graphiclayer="Graticle">4</excludelayer>
  <excludelayer graphiclayer="MGRSGrid">4</excludelayer>
</excludelayers>

Obvioulsly, it's not correct.  but I hope I'm on the right track.

Thanks
0 Kudos
AllisonShaw
New Contributor III
I was wrong--assuming that "current version" listed on each map service's REST directory refers to their version of ArcGIS Server, all the map services I consume are actually using version 10 or higher, yet some display a Show Description button and others don't, even with the same version (10.01)!? 

So I can upgrade to your TOC widget version 2.5.  Will it work with the Flex API 3.0 that's in beta now?   

Thanks,
Allison


Hi Robert,

Some of the external map services I rely on are not running ArcGIS Server 10 so as per your documentation, I am still using version 2.4.0 of your TOC widget.  Sorry, I would love to upgrade otherwise!  Possibly because these services aren't using ArcGIS Server 10, the "Show Description" button does not appear for these services, only for my internal services.  I'm wondering (a) if anything can be done about this, and (b) if not, could I somehow set up a work-around where the button links to a pop-up I populate myself instead of the ArcGIS Manager Map Service Description.  Is this something that you could help me with?

Thanks so much,
Allison
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Allison,

   I have not had a chance to test it with 3.0 Pre Release yet but I would say that it should work. I do know that SP4 for ArcGIS Server seems to have improved the response of my TOC Widget.
0 Kudos