Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Layer names are not present in the legend of my custom map template

$
0
0
I'm nearly done building my Flex web map, but I have one lingering problem that I have not been able to solve.

I'm using the advanced printing capability of Flex 3.2 and the Export Map/Print widget to send the current web map view to a custom map template MXD.

It all works well, except I'm having problems getting the legend to look the way I need it to. The problem is that the layer names are not added to my legend in the map template MXD. All I have are the field values and the symbol patches. I need the layer names in the legend because without them, the legend makes no sense.

Here's my setup:
1) In my map template MXD, I have the legend set to show only features that are visible in the map extent.

2) In my map template MXD, I have all the layers checked OFF in the ArcMap table of contents.

3) I'm using Robert's Enhanced TOC widget in my web map.

4) My PrintWidget.xml file is set up so that no layers are excluded from the legend (i.e., all layers from the web map get sent to the map template MXD.


Here's what the TOC in my web app looks like. Notice that the two layers Surface Patented and Surface Selected) have similar attribute values (native allotment, other private land, etc.). Because of this, it is essential that the layer names are included in the TOC in the web map and in the map template MXD legend. Below is a screenshot of the TOC in the web map, and you can see that everything is fine - no problems with it.

Attachment 23527



And here's what the legend in my map template MXD looks like. Notice that the layer names are missing. This makes it impossible to associate the symbol patches and values with a particular layer.

Attachment 23528



Below is a Photoshop mock-up of how I need the legend to appear in my map template. Notice that it has the layer names associated with the attribute values.

Attachment 23529




I have tried using the <excludelayerfromlegend> tag in my PrintWidget.xml file, and then relying on the legend in my map template MXD to supply the layer names in the legend. But the problem with that is, for any legend entries to show up at all, I have to turn on all the layers in the MXDs table of contents (they all have to be turned on because I won't know which layers the user has turned on in the web map TOC). So if the user has only two layers turned on in the web map, and nine layers are turned on in the MXD table of contents, then the resulting map legend shows nine layers instead of only the two that the user has turned on in the web map. So it seems like I have to have all the layers turned off in the MXD table of contents, and rely on the Print Widget to supply the layers that are turned on in the web map.

So, my question is, what am I doing wrong? Am I correct in thinking that the Print Widget should include the layer names in the legend of my custom map template? I'm stumped.
Attached Thumbnails
Click image for larger version

Name:	toc.png‎
Views:	N/A
Size:	170.8 KB
ID:	23527   Click image for larger version

Name:	TOC-map-template-incorrect.png‎
Views:	N/A
Size:	219.9 KB
ID:	23528   Click image for larger version

Name:	TOC-map-template-desired-result.png‎
Views:	N/A
Size:	168.7 KB
ID:	23529  

Viewing all articles
Browse latest Browse all 2097

Trending Articles