Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

OK, I've been labeling using the LabelEngine and simple expressions and it is working for every layer. I want to offer the option of labeling only selected features and thought it would be this simple:

annotateLayerProperties.LabelWhichFeatures = esriLabelWhichFeatures.esriSelectedFeatures;

Unfortunately that doesn't do it. Every polygon is still labeled. I verified that the features were selected (I have a routine that just returns the selected keys.) I also tried replacing the Engine labeling with a:

annotateLayerProperties.WhereClause = BuildWhere( keyName, selected );

using both my keys and the features OIDs - that does not label at all.

Does anyone know how to label only the selected features?

share|improve this question
    
I have just a quick two cents worth. I too am looking to label only "selected" features. I am printing small (8.5" x 11") working copy maps for field workers to use while checking business addresses for accuracy. If I send them out with a small map to a group of businesses on a street corner, I want ONLY the addresses for the businesses that I select and in a size that makes it easy to make corrections directly in the address fields I have printed. Unfortunately, at the scales that I want to use, I get ALL of the businesses and ALL of the idividual apartment numbers nearby. That makes it impos –  user9846 Aug 29 '12 at 16:10
add comment

1 Answer 1

up vote 2 down vote accepted

Labeling selected features is not currently possible in ArcGIS. The value you are setting on the property LabelWhichFeatures is overwritten by the labeling process and is not intended to be a persisted setting for this purpose. It main exists to power Convert Labels to Annotation which has a selected features option.

There is an existing enhancement request to provide labeling for selected features, but we'd like to understand the workflows that people are trying to fulfill with this requested functionality. If you can provide any details here, it would be helpful. <- If it is not obvious, I work on labeling at Esri.

share|improve this answer
    
Simple example: the user is trying to print a map (not persist data for all time!) with a list of properties derived from a joined database table using only a limited subset of features previously selected. OR maybe they want to compare feature properties dynamically based on the the selected subset. –  Chaz Dec 16 '11 at 15:28
    
Also, just from a usability standpoint having fewer labels on screen makes it easier to see the labels and diminishes the need for tweaking to make to make them legible. –  Chaz Dec 16 '11 at 15:31
    
Can I also ask another question? Is it possible to use balloon callouts in dynamic labels or must they be converted to annotations also? –  Chaz Dec 16 '11 at 15:33
    
I would like to point out that the IAnnotateLayerProperties.WhereClause can be used to label only selected features if you can build a working clause for the selected keys. Took me a while to get this to work because it would only accept a field name without delimiters (even tho elsewhere it requires the delimiters!?) –  Chaz Dec 21 '11 at 14:50
    
Obviously I understand the need to label subsets, but when doing the analysis you mention in the first comment, would you want to show this with the feature selection symbol etc. too? I imagine in most cases I would create a new layer with a definition query so it is a bit more permanent than a selection. –  Craig Williams Jan 19 '12 at 2:41
add comment

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.