Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

121308
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
RyanMalhoski
Deactivated User
Robert,

Well, I was working on 2.4, the whole time I have been working on the site I was told it was 2.5. :eek: Just did a test run of the widget in the "I know for sure it's 2.5" viewer and it works perfectly. Oops.

Thanks for the help and once again thank you for all the coding and time you have spent to make this community great! 😄
0 Kudos
ScottBackstrom
Deactivated User
First... thank you so much for all your apps!!

Question... I believe I am missing something very basic. I have the newest version and it displays the TOC and legend perfectly, however i cannot seam to find where to activate the tool tip that allows transparency, layer order, etc.

I am using the complied version with no changes.

Any suggestions?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   Sounds like you are trying to use this in a viewer version other than Flex Viewer 2.5 as the download states is required.
0 Kudos
ScottBackstrom
Deactivated User
DOH! you are correct sir. I thought I had 2.5 but have 2.4.  You will be happy to know that your app works pretty darn good in 2.4 (except for the pop up).

THANKS!!!
0 Kudos
LeroyChristophersen
Emerging Contributor
Transparency is controled in the Config file where you have established what the operational layers will be used.  Here is my example, where the layer is pre-set at 60% transparency by "alpha=.60".
"  <layer label="Oroville" type="dynamic" visible="true" alpha=".60"
                   url="http://owidarc/ArcGIS/rest/services/MapGuideTestServer/MapServer"/>
Within the table of contents, you can then click on the downward arrow next to the layer and adjust order and increase and decrease transparency.

Leroy

First... thank you so much for all your apps!!

Question... I believe I am missing something very basic. I have the newest version and it displays the TOC and legend perfectly, however i cannot seam to find where to activate the tool tip that allows transparency, layer order, etc.

I am using the complied version with no changes.

Any suggestions?
0 Kudos
ScottBackstrom
Deactivated User
Thank you for the feedback.

I upgraded to flex 2.5 and the tool is now working perfectly.:cool:
0 Kudos
JimBranch
Emerging Contributor
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
0 Kudos
JeffreyUtter
Deactivated User
Robert,
I'm running FV 2.4 and your TOC/Legend Widget does work, although I know it's really for 2.5.
I have a few questions. My Map Contents shows a "Layer Visibility" and it say"set parent map service to select opacity". Can you clarify what that means and how to do it?

Second, How to I delete the "More" and retain all the operational Layers that will show in the Map Contents?

Third, can you have more than one TOC/Legend, specify which Layers I want in it, and specify a separate name for it?

Jeffrey
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jim,

    The FeatureLayer is added to the top of the toc because of this block of code in the TOC.as registerMapLayer function:
            } else if (layer is FeatureLayer) {
                var msName:String = FeatureLayer(layer).url.replace("FeatureServer","MapServer");
                if(msName.substring(msName.length - 9) != "MapServer")
                {
                    var arc:ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(msName.substring(0,msName.lastIndexOf("/")));
                    if(arc.loaded){
                        tocItem.ttooltip = arc.serviceDescription
                    }else{
                        ready = false;
                        arc.addEventListener(LayerEvent.LOAD, 
                            function(event:LayerEvent):void{
                                tocItem.ttooltip = ArcGISDynamicMapServiceLayer(event.layer).serviceDescription;
                                _tocRoots.addItemAt(tocItem, 0);
                                if(_expanded) expandItem(tocItem, true, true, false, null);
                            });
                    }
                }
            }
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeffrey,

   If you were attempting to run the 2.5 version than it would not work at all and it would not look like the older version that you are using.


  1. I am pretty sure it says "Select parent map service to select opacity" which means click on the parent map service in the toc. then the slider will function to adjust the layers opacity.

  2. Deleteing the More button will not affect the operational layers that are displayed in the toc or the map. Just follow the directions and see.

  3. No.

0 Kudos