Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

122265
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
MLowry
by
Frequent Contributor
Robert, I don't suppose there is anything we can do to fix this leak shown in the Debug Mode in Flash Builder?
Any direction you could lead me to look into it or is it no big deal?

[SWF] \bin-debug\widgets\TOC\TOCWidget.swf - 511,883 bytes after decompression
warning: The class widgets.TOC.toc.tocClasses.LegendDataClassItem has been used in a call to net.registerClassAlias() in _TOCWidget_FlexInit. This will cause widgets.TOC:TOCWidget to be leaked. To resolve the leak, define widgets.TOC.toc.tocClasses.LegendDataClassItem in the top-level application.   
warning: The class widgets.TOC.toc.tocClasses.LegendDataItem has been used in a call to net.registerClassAlias() in _TOCWidget_FlexInit. This will cause widgets.TOC:TOCWidget to be leaked. To resolve the leak, define widgets.TOC.toc.tocClasses.LegendDataItem in the top-level application.   
warning: The class widgets.TOC.toc.tocClasses.LegendSymbolItem has been used in a call to net.registerClassAlias() in _TOCWidget_FlexInit. This will cause widgets.TOC:TOCWidget to be leaked. To resolve the leak, define widgets.TOC.toc.tocClasses.LegendSymbolItem in the top-level application.   

0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   Straight from the readme.txt


THank you and I apologize for wasting your time. I should have read it more thoroughly.
0 Kudos
CK1
by
Deactivated User
Hey Robert,

thanks for the new Version and the Major Change. Great Stuff.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
M Lowry,

   I will look into it.
0 Kudos
AdrianKordylas
Deactivated User
Hello,

My name is Adrian and I'm student from Poland. I have download your widget and it is great! However, I have little problem with largeness of symbols. In enclosed file you can see what I mean. Images are too large and text titles are covered. Can I modify this widget to repair this and how can I do it? Could you help me?

Thanks,
Adrian

My project: http://www.warszawskastarowka.pl/mapa/
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Adrian,

   Wow I can't believe you are the first to report this issue. The fix is 2 simple lines of code and I will add them to the next release. If you happen to be using the uncompiled version than you can add the fix your self by opening the TocMapLayerItem.as and find the loadImage function and add the two lines below in red:

        private function loadImage(imageData:String):Image
        {
            const base64Dec:Base64Decoder = new Base64Decoder();
            base64Dec.decode(imageData);
            const byteArr:ByteArray = base64Dec.toByteArray();
            
            const loader:Loader = new Loader();
            const lc:LoaderContext = new LoaderContext(false);
            const image:Image = new Image();
            image.maxHeight = 30;
            image.maxWidth = 30;
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
                function(e:Event):void
                {
                    image.smoothBitmapContent = true;
                    image.source = e.currentTarget.content;
                });
            loader.loadBytes(byteArr, lc);
            return image;
        }


Also you may want to st your maps top attribute back to 40 unless you have some reason for the 100 empty pixels above your map.

Don't forget to click the top arrow (promote).
as shown in the below graphic:
0 Kudos
GregBowie
Emerging Contributor
RS,

I am having trouble with the TOC. I have it in the config file and I turned off the layervisibility in the map switcher. When the viewer loads and I open the Map Contents 1) nothing shows up, 2) the symbols are unknown to the legend, 3) I can no longer zoom in or out (only pan).

Some of the layers do not have defined min/max (could that be the issue?). Even layers that do have defined min and max (such as my mosaic dataset), does not show up.

Thoughts?

Here is a screen grab for reference.

Greg

[ATTACH=CONFIG]14303[/ATTACH]
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Greg,

   A couple of questions...

  1. Are you using Flex Viewer 2.5?

  2. Is your ArcGIS Server at least version 10?

Hopefully you saw these requirement in the documentation of the download.
0 Kudos
GregBowie
Emerging Contributor
Yes on both fronts. I went through the read-me file and made sure to follow the instructions. I will note that the same issue occurs with the "Legend" widget from ESRI.


Greg,

   A couple of questions...

  1. Are you using Flex Viewer 2.5?

  2. Is your ArcGIS Server at least version 10?

Hopefully you saw these requirement in the documentation of the download.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Greg,

   Hmm... that actually helps a lot. it points to the possibility that you have changed something in the standard setup of your ArcGIS Server. Did you happen to disable anonymous access to your ArcGIS output folders or change some setting in IIS  to require authentication?
0 Kudos