Dynamic Legend widget for Flexviewer 2.0

7369
65
07-29-2010 01:18 PM
RobertScheitlin__GISP
MVP Emeritus
All,

    I am happy to announce the first community developed (and shared on the code gallery) widget for the Flexviewer 2.0. I have finalized my Dynamic Legend Widget for the 2.0 FlexViewer and shared it for all to use.

This version is COMPLETELY dependent on 2 things

  1. ArcGIS Server 10 map services

  2. Flex Viewer 2.0 and obviously Flex API 2.0


I have made it XML configurable this time so that you can specify that certain map services or certain layers in a map service are not to be displayed in the widget.

It is called dynamic because the legend will only draw map services and layer that are visible in your map. It respects scale dependency of layers and if the layer is checked in the TOC or operational layer TOC. The legend automatically redraws when layers have been checked/unchecked and when zooming in or out and a layer scale dependency has been meet.

I hope you enjoy it and I HOPE that you read and understand that it will not work with mapservices that are not served from a ArcGIS 10 Server.

http://www.arcgis.com/home/item.html?id=f60406b9f52340d59eb557bf64136af6

PS. don't forget to rate the code.
Tags (2)
0 Kudos
65 Replies
JoshuaCoates
Deactivated User
I guess it would help if I specified that I am wanting to show all layers and symbology for my map. I currently have three seperate map services configured into my xml. A basemap, and then i have 3 operational layers <one of which is the same as the basemap>. I am not sure if this widget is what I need to do this, but I think it seems like it is. I just want users to be able to see what the symbology and colors on the map mean like you can see the symbology of the TOC in ArcMap.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joshua,

   I guess it is not clear enough in the DynamicLegendWidget.xml that the only thing you put in there is if you want to exclude a particular map service or map service layer. There is no configuration needed if you want everything to appear in the legend. As the example site shows this widget does not display the symbology in the TOC like in ArcMap but it shows all the visible layers of the map in the widget window. So if you do not have a layer visible than it will not be in the legend.
0 Kudos
JoshuaCoates
Deactivated User
SO what do I need in order to display symbology of all layers. If they can turn on a layer and look at the dynamic legend that is fine...it serves the purpose I need served. However, if there is a way to have symbology displayed in the layer list where u turn layers on and off...that would be great. I still can not figure out why the widget is not showing up with my other widgets?!
0 Kudos
philippschnetzer
Frequent Contributor
Great Legend!!  Only one issue I am having...I would like to have the widget floating, but if I do this the widget is preloaded=open automatically (whether you specify it in the main config.xml or not) and it does not show up on the header....so that if you close the widget it disappears for good.  I think it's important to be able to drag and resize this widget but it should still appear in the header if floating...

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Philipp,

   I can not duplicate your issues can you post your config.xml?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joshua,

   The whole purpose of this widget was to minimize the legend to only those items (ACTUALLY) in the map.
I still can not figure out why the widget is not showing up with my other widgets?!
I am not sure what you mean by this?
0 Kudos