Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

137851
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
RobertScheitlin__GISP
MVP Emeritus
All,

Version 3.1.5 - Feb 4, 2013
* Fixed issue with turning on or off sublayers of a group.


One important note if you have a group turned off and all of its sub layers turned off as well then the group will not be able to turn back on until at least on of the sublayers is turned on.
0 Kudos
ronaldmcfarlane
Regular Contributor
All,

Version 3.1.5 - Feb 4, 2013
* Fixed issue with turning on or off sublayers of a group.


One important note if you have a group turned off and all of its sub layers turned off as well then the group will not be able to turn back on until at least on of the sublayers is turned on.


GitHub and ArcGIS.com both have 3.1.4 not 3.1.5.  Maybe I'm too early.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ronald,

   Try again. I believe I have all the links updated now.
0 Kudos
ronaldmcfarlane
Regular Contributor
Robert:
You are correct, thanks again!
0 Kudos
DanMiller
Emerging Contributor
Hi Robert and others,

I can't seem to get this service working in the TOC widget.  Not sure if it's actually the service or something with my Flex Viewer?  I am receiving a bunch of errors trying to load it in my operational layers.
http://tm2-elb-1378978824.us-east-1.elb.amazonaws.com/arcgis/rest/services/LiveFeeds/NOAA_storm_repo...

Dan
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dan,

   I loads for me without errors in Version 3.1.5 of the TOC Widget... Which version are you using?
0 Kudos
GISDev1
Deactivated User
Hi Robert and others,

I can't seem to get this service working in the TOC widget.  Not sure if it's actually the service or something with my Flex Viewer?  I am receiving a bunch of errors trying to load it in my operational layers.
http://tm2-elb-1378978824.us-east-1.elb.amazonaws.com/arcgis/rest/services/LiveFeeds/NOAA_storm_repo...

Dan


Service is loading into my TOC widget just fine like this:

<layer label="Test" type="dynamic" visible="false"
                   url="http://tm2-elb-1378978824.us-east-1.elb.amazonaws.com/arcgis/rest/services/LiveFeeds/NOAA_storm_reports/MapServer"/>
0 Kudos
DanMiller
Emerging Contributor
Dan,

   I loads for me without errors in Version 3.1.5 of the TOC Widget... Which version are you using?


Hey Robert and GISDev01,

The latest version did the trick, I had been using 3.1.4.  Thanks!

Dan
0 Kudos
ScottMcGee
Regular Contributor
I'm using Robert's TOC/Legend widget (I'm using the version that is posted on http://www.arcgis.com/home/item.html?id=e2cb71d5c04d40d19e9f945ae0db7ce8 - I downloaded it about 10 days ago, so I'm not sure if there's a more current version). Anyway, the widget works just fine, but I have come across an issue when exporting the web map to a PDF file, and I'm not sure if the issue is related to the TOC/Legend or to the Export Web Map tool. So I thought I'd post this here in case anyone has some insight on the issue.

First, some background. I've created a web mapping app (using ArcGIS 10.1 and Flex 3.1) and added the Print widget to the map so that users can export/print their web map. I also created my own custom map template MXD files to use in place of the default map templates that are provided in ArcGIS.

My custom map templates have a dynamic legend that shows only layers and features that appear in the viewed map extent. Everything works as expected in my map template MXD. As I zoom out, more different types of features are shown in the map, with their corresponding symbols being added to the dynamic legend. Likewise, when I zoom in to a smaller area, there are fewer different types of features, and the dynamic legend has correspondingly fewer symbols. So that all works just fine in my MXD template.

However, when I use the Print widget (which uses the Export Web Map tool) in my web map to export the currently viewed map to a PDF file, the legend in the resultant PDF actually has two legends: one legend is coming from Robert's TOC/Legend widget, and the other legend is the dynamic one from my map template MXD. You can see this in the attached file named 1-Correct-Map--Wrong-Legend.jpg. This isn't what I need - I need only the dynamic legend from my MXD.

In troubleshooting the issue, in my web map I turned off visibility for all layers (except the raster base map) and exported to PDF. The resultant PDF correctly shows only the dynamic legend from my MXD template, but of course with all the layers turned off in the web map, the map is blank, except for the raster base map (see attached file named 2-Wrong-Map--Correct-Legend.jpg).

So what I need is the map from #1 (which comes from the current view in the web map) and the dynamic legend from #2 (which comes from my MXD template). I used #1 and #2 to create a mock-up in Photoshop that shows what I want my web-map-exported-PDF file to look like (see attached file named 3-Desired-Result.jpg - this exactly matches my MXD template).

I'm not sure how Robert's TOC/Legend widget and the Export Web Map tool interact with each other. But logically it seems that one of two scenarios is taking place:

Scenario 1
Robert's TOC/Legend widget is taking the lead and passing it's legend to the Export Web Map tool, which in turn adds it to the dynamic legend that exists in the MXD template. If this is the case, then is there a way to have Robert's TOC/Legend widget suppress the sending of its legend to the Export Web Map tool?

--or--

Scenario 2
The Export Web Map tool is taking the lead and requesting the current web map legend, which is dutifully supplied by Robert's TOC/Legend widget. If this is the case, is there a way to tell the Export Web Map tool to not request the legend from the web map, and instead use only the dynamic legend from the MXD template?


So, any thoughts on how I can achieve the desired web-map-exported-with-a-dynamic-legend-PDF result?

(does any of this even make sense?)

Thanks,
Scott


[ATTACH=CONFIG]22491[/ATTACH][ATTACH=CONFIG]22492[/ATTACH][ATTACH=CONFIG]22493[/ATTACH]
0 Kudos
ScottMcGee
Regular Contributor
Thanks to Robert's expert help, I've solved the issue I posted directly above. All I needed to do was insert the <excludelayerfromlegend> tag in my Print widget XML file in order to exclude the desired layers from the dynamic legend in my MXD template.

This explains the Print widget configuration:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Print_widget_tags/01m30000001n0...


Scott
0 Kudos