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
Solved! Go to Solution.
Kamal,
You can not have two symbols for the same graphic. You have to clone the graphic and have two graphics each with their own symbol.
Kamal,
You can not have two symbols for the same graphic. You have to clone the graphic and have two graphics each with their own symbol.
If u wanna do something like:
U have to do it through the service in arcmap.