Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

122384
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
giuseppemolinario
Deactivated User
Giuseppe,

  My legend definitely ignores rasters.



Thanks Robert for the quick reply -

any idea if there is another widget out there that does?
to display a raster legend my only option is displaying a static jpeg like the US Static Mapper sample?
http://help.arcgis.com/en/webapps/flexviewer/live/index.html?config=config-thematic.xml

thanks

G.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Giuseppe,

  I don't know of any current widget that handles raster legends. So yes you probably have to use the static image solution. Here is a link to something but it really isn't what you are looking for but you might be interested in it.

http://thunderheadxpler.blogspot.com/2010/09/dynamic-legend-generation-from-image.html
0 Kudos
EricVenden
Frequent Contributor
Robert,

Is it possible to exclude annotation layers from the layer list using your TOC?  They do not show up in the legend, but I would like to also exclude them from the layer list.  I have tried the following to no avail.

<LegendexcludeLayer mapservice="Parcels">0</LegendexcludeLayer>
<LegendexcludeLayer mapservice="Parcels">4</LegendexcludeLayer>
<LegendexcludeLayer mapservice="Parcels">6</LegendexcludeLayer>

Where Parcels is the name of the map service and 0,4,and 6 the endpoints for the specific annotation layers I would like to remove.

Thanks for your time.
Eric V
Gurnee, IL
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   The LegendexcludeLayer element only excludes the layer from the legend. The TOC component only allows you to exclude a whole map service and not individual layers of a map service.
0 Kudos
RaymondBlack
Emerging Contributor
Hi Robert,

I'm having a little problem with the legend portion of this widget (and the standalone dynamic legend widget as well).  Basically the legend doesn't render the same as the legend on the REST interface.  I am using ArcGIS server 10 SP1, and version 2.2 of the viewer and Flex API.  The attached screenshots explain what I mean.  In the example enclosed the 'FIRES' layer should be a striped red fill, but the legend widget displays it as a solid fill.  Similarly the excised layers should be a blueish stripe, but again they render as solids on the dynamic legend.  I have attached a shot of the map which displays correctly and the images as they appear on the rest interface.  I am using your legend widget because the new ESRI one (version 2.2) jsut doesn't work at all.  (legend.png is the image of the legend in the dynamic legend widget).

If you have any ideas I'd be grateful. 

Thanks,

++ Ray
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ray,

   Are you using the compiled or uncompiled? I ask because I can but a version in the download that is exclusively for ArcGIS server 10 SP1 that will work for you I just need to know if I need to add the compiled version of it as well.
0 Kudos
RaymondBlack
Emerging Contributor
Hi Robert,
Thanks for getting back so quickly. I'm using the uncompiled version because I need to package it slightly different to the standard widget.

Regards,

++ Ray
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ray,

   Last thing (maybe) are you using ONLY layers that are coming from a 10 sp1 server?
0 Kudos
RaymondBlack
Emerging Contributor
Hi Robert,

Yes.  I have only one mapservice which is hosted on an ArcGIS 10 SP1 instance.  The mxd was built with ArcMAP 10 (Build 2800).  The service does have a lot of layers (148) divided into several groups.  So the hierarchy descends at least 3 levels in many cases, although the REST legend service appears to ignore the hierarchy and just attach the image to the layer ID.

Cheers,

++ Ray
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ray,

   I think the mixture is going to be an issue I have code that works for either ArcGIS Server 10 or ArcGIS Server 10 with SP1. I don't have anything yet that works with both.
0 Kudos