3

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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Dec 15, 2011 at 21:36
1
  • 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 Commented Aug 29, 2012 at 16:10

2 Answers 2

3

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.

answered Dec 16, 2011 at 7:07
5
  • 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. Commented Dec 16, 2011 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. Commented Dec 16, 2011 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? Commented Dec 16, 2011 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!?) Commented Dec 21, 2011 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. Commented Jan 19, 2012 at 2:41
1

One possible work around is to: "create layer from selected features" and label that (maybe making all the geometry transparent). A smart cookie could make a model or add-in to do it.

answered Dec 21, 2015 at 3:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.