AnsweredAssumed Answered

How to add two symbols in a single graphic ?

Question asked by kamalmtxb2b on Jul 24, 2017
Latest reply on Jul 24, 2017 by endlessdsire

I am trying to add a SimpleFillSymbol() and TextSymbol() in a single graphics() after draw polygon on the feature layer. Independently they are working fine but i want to combine these two symbols.

 

Here is the code : 

// SimpleFillSymbol code

var symbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([r,g,b,0.9]),
4
),new Color([r,g,b,0.5]));

 

//TextSymbol code

var symbol1 = new esri.symbol.TextSymbol();
symbol1.setText("tsText");
symbol1.setColor(new dojo.Color([0, 255, 0]));

 

var graphic = new Graphic(evt.geometry, symbol);
map.graphics.add(graphic);

 

I have attach the HTML file of a sample feature layer.

 

Thanks

Attachments

Outcomes