1

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?

3
  • A code example may help here. I also suspect you're also talking about labels and not annotation although the API intermixes terminology. Commented Nov 2, 2011 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
    Commented Nov 2, 2011 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
    Commented Nov 2, 2011 at 15:02

0

Your Answer

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

Browse other questions tagged or ask your own question.