AnsweredAssumed Answered

How can I get a marker symbol and a text symbol to appear next to each other?

Question asked by Russ.W on May 31, 2012
Latest reply on May 31, 2012 by ldonahue
Hello all,

I am currently having an issue trying to get a marker symbol and a text symbol to appear side by side.  currently it is not working any help/suggestions would be greatly appreciated on this. 

This is the current implementation:

This is the desired implementation (i moved the symbols manually to show what i want):

This is my code currently
IMarkerElement marker_elm = new MarkerElementClass();
marker_elm.Symbol = (IMarkerSymbol)EventRenderer.Instance.GetClusterSymbol();
IElement markELM = (IElement)marker_elm;

IPoint test = new PointClass();
test.X = -117.230968;
test.Y = 33.786846;
markELM.Geometry = test;

double xmax = markELM.Geometry.Envelope.LowerRight.X;
graphicsContainer.AddElement(markELM, 0);

test.X = xmax;
IRgbColor color = new RgbColorClass();
color.Blue = 255;
color.Green =255;
color.Red = 255;
IFillSymbol fillSym = new SimpleFillSymbolClass();
fillSym.Color = color;

ITextElement textELM = new TextElementClass();
textELM.Text = "THIS IS A TEST";
IFormattedTextSymbol textSymbol = new TextSymbol();

IPoint test2 = new PointClass();
test.PutCoords(xmax, 33.786846);

IBalloonCallout callout = new BalloonCalloutClass();
callout.Symbol = fillSym;      
callout.Style = esriBalloonCalloutStyle.esriBCSRoundedRectangle;

textSymbol.Background = (ITextBackground)callout;
textELM.Symbol = textSymbol;

IElement elm = (IElement)textELM;
elm.Geometry = test;
graphicsContainer.AddElement(elm, 0);

Again any help would be greatly appreciated.