AnsweredAssumed Answered

CompositeSymbol with TextSymbol

Question asked by steelis2013 on May 15, 2015
Latest reply on Jun 10, 2015 by XWu-esristaff

Hi Everyone,

 

I have recently created a CompositeSymbol that consist of a PictureMarkerSymbol, TextSymbol and a SimpleMarkerSymbol.

 

After adding the CompositeSymbol into the GraphicLayer, I realize that the TextSymbol within the added GraphicSymbol have actually lost the Font information.

 

This is a portion of the code where the CompositeSymbol is created and the values tested:

 

Graphic graphic = CreateACompositeSymbol();

if (graphic != null) {

   int graphicUID = graphicslayer.addGraphic(graphic);

   Graphic graphicAdded = graphicslayer.getGraphic(graphicUID);

  Symbol symbol = graphicAdded.getSymbol();

   if(symbol instanceof CompositeSymbol){

  CompositeSymbol compositeSymbol = (CompositeSymbol) symbol;

  List<Symbol> listofSymbols = compositeSymbol.getSymbols();

   for(Symbol innerSymbol : listofSymbols){

   if(innerSymbol instanceof TextSymbol){

   float size = ((TextSymbol) innerSymbol).getSize();

  }

  }

  }

 

I think you can create your own composite symbol then just place a breakpoint at the last line to see the difference in the Font value for the TextSymbol in the graphic and graphicAdded object. The text value is the same and the color in the Attributes map is correct though.

 

Can anyone confirm if they have the same problem?

 

Thanks in advance for any help.

Outcomes