AnsweredAssumed Answered

Adding a text symbol to the GraphicTracker

Question asked by Adjutant on Jul 12, 2012
Latest reply on Jul 13, 2012 by Adjutant

The following code successfully associates a label (textsymbol) with another existing symbol - and correctly displays both symbols.
// Create and define some other symbol simpleMarkerSymbol = GenerateMarkerSymbol(); simpleTextSymbol = GenerateSimpleTextSymbol(); PointClass offset = new PointClass() { X = 0, Y = 0 };  // Add the symbol to the tracker IGraphicTrackerSymbol gts = graphicTracker.CreateSymbol(simpleMarkerSymbol); int gID = graphicTracker.Add(offset, gts);  // Associate the text symbol, and set the text graphicTracker.SetTextSymbol(gID, simpleTextSymbol); graphicTracker.SetLabel(gID, "Testing");

However, now I want all text to be displayed on top of other symbols.
ESRI recommends using a separate tracker for prioritizing display order - and this works.
The problem is that when I add ONLY a text symbol to the tracker, then it is not displayed...
Why does the graphicTracker not display the generated text symbol below? (textFont is defined and was used for the textSymbol in the code which displayed correctly above) :

// Define text symbol ITextSymbol textSymbol = new TextSymbolClass() as ITextSymbol; textSymbol.Font = textFont; textSymbol.Size = 20.0; textSymbol.Color = new RgbColorClass() { RGB = 0xFF0000 }; textSymbol.Text = "12345";  // Add it to the tracker PointClass offset = new PointClass() { X = 0, Y = 0 }; IGraphicTrackerSymbol gt = graphicTracker.CreateSymbol(textSymbol as ISymbol, null); int gID = graphicTracker.Add(offset, gt);