Select to view content in your preferred language

Viewer 3.0 Legend Widget Showing all layers

582
7
Jump to solution
06-15-2012 12:52 PM
DerrickMartin
Emerging Contributor
Using the new 3.0 flex viewer and having some issues with the Legend Widget. It appears to be loading all layers in my configuration whether they are turned on or not. This happens when the widget first loads. If I then turn a layer on and back off, it is properly removed from the legend. But, as it stands now, the widget takes forever to load as it's building the legend for 50+ layers that are set as visible="false" in the config. File. Anyone else seeing this behavior.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SarthakDatt
Frequent Contributor
Thanks for reporting this. Looks like a bug with the Legend component. This happens for any Dynamic Map Service layer with atleast one sublayer visible. As a workaround for now, if you are using the un-compiled viewer, you can use the updated Legend Skin(attached) for the Legend component used in the Legend Widget.

add this to LegendWidget.mxml and make sure to copy the skin file to widgets/legend folder
<fx:Style>         @namespace s "library://ns.adobe.com/flex/spark";         @namespace mx "library://ns.adobe.com/flex/halo";         @namespace esri "http://www.esri.com/2008/ags";         @namespace viewer "com.esri.viewer.*";                  esri|Legen         {             skin-class: ClassReference("widgets.Legend.LegendWidgetLegendSkin");         }     </fx:Style>


Hope this helps

View solution in original post

0 Kudos
7 Replies
SarthakDatt
Frequent Contributor
Thanks for reporting this. Looks like a bug with the Legend component. This happens for any Dynamic Map Service layer with atleast one sublayer visible. As a workaround for now, if you are using the un-compiled viewer, you can use the updated Legend Skin(attached) for the Legend component used in the Legend Widget.

add this to LegendWidget.mxml and make sure to copy the skin file to widgets/legend folder
<fx:Style>         @namespace s "library://ns.adobe.com/flex/spark";         @namespace mx "library://ns.adobe.com/flex/halo";         @namespace esri "http://www.esri.com/2008/ags";         @namespace viewer "com.esri.viewer.*";                  esri|Legen         {             skin-class: ClassReference("widgets.Legend.LegendWidgetLegendSkin");         }     </fx:Style>


Hope this helps
0 Kudos
ZahidChaudhry
Deactivated User
Using the new 3.0 flex viewer and having some issues with the Legend Widget. It appears to be loading all layers in my configuration whether they are turned on or not. This happens when the widget first loads. If I then turn a layer on and back off, it is properly removed from the legend. But, as it stands now, the widget takes forever to load as it's building the legend for 50+ layers that are set as visible="false" in the config. File. Anyone else seeing this behavior.


I am experiencing same problem....
0 Kudos
DerrickMartin
Emerging Contributor
Thanks for reporting this. Looks like a bug with the Legend component. This happens for any Dynamic Map Service layer with atleast one sublayer visible. As a workaround for now, if you are using the un-compiled viewer, you can use the updated Legend Skin(attached) for the Legend component used in the Legend Widget.

add this to LegendWidget.mxml and make sure to copy the skin file to widgets/legend folder
<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/halo";
        @namespace esri "http://www.esri.com/2008/ags";
        @namespace viewer "com.esri.viewer.*";
        
        esri|Legen
        {
            skin-class: ClassReference("widgets.Legend.LegendWidgetLegendSkin");
        }
    </fx:Style>


Hope this helps


Thanks for the help. When I try to use the attached LegendWidgetSkin.mxml getting errors because it can't resolve "            [Embed(source="../../../../assets/skins/loader.swf")]" any ideas where I should point this to? I'm guessing my environment is setup different than yours?

Never mind. I was able to locate the resources in the api download. I'd only copied the main flex api into my project.
0 Kudos
JosephAccardi
Regular Contributor
Will there be any fix for the FV 3.0 complied-verison users?
0 Kudos
deleted-user-90dJTUzLc1x8
Deactivated User
Hi guys!
I still don't know how to fix the unable to resolve '../../../../assets/skins/loader.swf' for transcoding error...
Could you point me to the right direction?
Thanks!
0 Kudos
DerrickMartin
Emerging Contributor
Hi guys!
I still don't know how to fix the unable to resolve '../../../../assets/skins/loader.swf' for transcoding error...
Could you point me to the right direction?
Thanks!


I just copied the assets/skins folder from the api samples download into my project. Then changed the references to point to '../../assets/skins/loader.swf' for each item in the new skin file... This fixed it for me.
0 Kudos
BrettElliot
Deactivated User
Thanks for reporting this. Looks like a bug with the Legend component. This happens for any Dynamic Map Service layer with atleast one sublayer visible. As a workaround for now, if you are using the un-compiled viewer, you can use the updated Legend Skin(attached) for the Legend component used in the Legend Widget.

add this to LegendWidget.mxml and make sure to copy the skin file to widgets/legend folder


Correct me if i'm wrong, but I believe there was a typo in the code segment that was pasted above.  It didn't work for me until i added the "d" to 'esri|Legend'.

<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/halo";
        @namespace esri "http://www.esri.com/2008/ags";
        @namespace viewer "com.esri.viewer.*";
        
        esri|Legend
        {
            skin-class: ClassReference("widgets.Legend.LegendWidgetLegendSkin");
        }
    </fx:Style>


Also, thanks Derrik for posting about the "../../assets/skins" problem.  I used your method and it works for me now.
0 Kudos