Adding a text symbol to the GraphicTracker

1198
1
Jump to solution
07-12-2012 04:02 AM
ManfredLauterbach
Occasional Contributor
Hello,

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);
0 Kudos
1 Solution

Accepted Solutions
ManfredLauterbach
Occasional Contributor
There seems to be no other way to do this.
The next best (but undesirable) alternative is to create a dummy(placeholder) symbol, and then associate the desired text symbol.

This also creates significantly more administrative work, because since we are now working with multiples trackers, we have to maintain symbols and geometries for both.

View solution in original post

0 Kudos
1 Reply
ManfredLauterbach
Occasional Contributor
There seems to be no other way to do this.
The next best (but undesirable) alternative is to create a dummy(placeholder) symbol, and then associate the desired text symbol.

This also creates significantly more administrative work, because since we are now working with multiples trackers, we have to maintain symbols and geometries for both.
0 Kudos