Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using ArcGIS Desktop, is there a way for the legend, to only show the subitems that are displayed on the map?

share|improve this question
    
Did you try converting the legend into graphics? After converting into graphics you can manually delete the items in legend that you do not need. I hope that helps. Thanks. – Raj Jan 6 '11 at 13:45
1  
@Raj - Oh no, I don't plan on doing that maintaining the maps will be pain – dassouki Jan 6 '11 at 14:14
1  
The linked question is another question that has been answered. So ask a new question describing your problem in detail. – MathiasWestin Jul 24 '11 at 17:11
1  
The old question is tagged arcgis 9.3, so you should be OK asking a new question and tagging for ArcGIS 10. Also, the linked question is an answer and you are asking a troubleshooting question for legend limiter. – Jay Cummins Jul 24 '11 at 18:40
    
Also, troubleshooting questions can take some time to get traction and you should work to try and keep the question body organized with new information so that it's easy to follow. Or else other users will look it and move along to the next question. – Jay Cummins Jul 24 '11 at 18:44
up vote 7 down vote accepted

Legend Limiter

The Legend Limiter only works on layers that use "unique value categories" to define symbology. This style of legend can be set up in the Symbology tab of the Layer Properties dialog. Legend Limiter will not limit the symbology of layers set up with single symbol symbology.

http://arcscripts.esri.com/details.asp?dbid=16097

share|improve this answer
    
That is the closest to what I need, In essence, I have to convert all my symbology to unique value – dassouki Jan 6 '11 at 15:44
    
@ Mapperz - there's a fix for ArcGIS 10 here: forums.arcgis.com/threads/24968-Legend-Limiter-in-Arc-10 – Dano Jul 23 '11 at 15:04
    
@ Mapperz (or anyone) - I downloaded the necessary files fo Legend Limiter at the link I posted above. When trying to install, I received an error message, which I googled. I get the impression that there's no patch in existence making this add-on compatible with both ArcGIS 10 and Windows 7. On this thread, should I start a new question related to this topic? Or .... is anyone aware of a patch meeting both parameters (Arc 10 & Windows 7)/ – Dano Jul 24 '11 at 16:02
3  
Run in Windows compability mode on Windows 7. – Mapperz Jul 25 '11 at 4:00
    
Worked Mapperz - thank you & +1 – Dano Jul 25 '11 at 13:55

There is no need to write any additional ArcPy for this. Simply use dynamic legends (which were added at ArcGIS 10.1) when you are authoring your maps.

The Map Extent Options allow you to control how eligible legend items interact with the current map extent. If the Only show classes that are visible in the current map extent check box is checked, a legend item class will only appear in the legend if a feature from that class is in the current extent. If no features from that legend item are in the current extent, the entire item will be removed from the legend.

share|improve this answer

In the map view, right-click on the Legend to open the Properties window, then click the "Items" tab. Under "Map Extent Options", select "Only show classes that are visible in the current map extent". It'll refresh as you move around the map or toggle on/off classes within the layer.

share|improve this answer

i think this code will help:

import arcpy
import arcpy.mapping
import os
import sys
from arcpy import env
import string


env.workspace = r"C:\Project"
for mxdname in arcpy.ListFiles("*.mxd"):
    print mxdname
    mxd = arcpy.mapping.MapDocument(r"C:\Project\\" + mxdname)
    legend = arcpy.mapping.ListLayoutElements(mxd,"LEGEND_ELEMENT")[0]
    for lyr in legend.listLegendItemLayers():
        legend.updateItem(lyr, use_visible_extent = True)
        print 'updateItem'    
    mxd.save()
del mxd
share|improve this answer

in the legend properties, you can define which layers appear on the legend

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

    
That's true, but if let's say in your legend you have a road layer, and in that road layer, you have collectors, arterials, freeways all styled perfectly. If the map in the data frame contains no freeways, then the legend should not display freeway (a sub style of Roads) in the legend – dassouki Jan 6 '11 at 15:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.