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.

I have code that creates either a UniqueValueRenderer or a ClassBreaksRenderer and applies it. I also have code that uses AnnotateLayerProperties to set labels.

When I create a renderer and then an annotation or an annotation and then a renderer the map goes haywire - sometimes one displays and the other one is missing and rarely (without pattern) both display.

Must I use the OnDraw event (and save the annotation instructions) to ensure that annotations are reproduced? What can I do about the renderer? Can I save that and restore it in the OnDraw? In what order should these be drawn?

share|improve this question
A code example may help here. I also suspect you're also talking about labels and not annotation although the API intermixes terminology. –  Craig Williams Nov 2 '11 at 5:24
Every time I look up Label it sends me to something talking about IAnnotateLayerProperties! (I quit caring what the difference was and just wrote code until what I wanted showed up.) :-> As for code: I'd have to post about 8 source files before you could even follow it. –  Chaz Nov 2 '11 at 15:00
The simple answer (if there is one) is that I started caching the renderer. After I run the code to update the annotations (or labels or whatever they are called) I then reassign the active renderer back to the feature class and do a refresh. This (mostly) works. –  Chaz Nov 2 '11 at 15:02
add comment

Your Answer


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

Browse other questions tagged or ask your own question.