Select to view content in your preferred language

Change color of TextSymbol

1095
1
Jump to solution
09-12-2014 08:26 AM
VygintasCesnauskas
Occasional Contributor

I am looking for a way to change the color of a text symbol when user clicks on it. So far I have tried the following code, but it doesn't work:

graphicsLayer.on("click", function (evt) {

  evt.graphic.symbol.setColor(new Color([0, 255, 255]));

}

Is there anything I'm missing?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Try redrawing the graphics layer after you change the color. For  example:

                e.graphic.symbol.setColor("blue");

                graphicsLayer.redraw();

View solution in original post

1 Reply
KellyHutchins
Esri Frequent Contributor

Try redrawing the graphics layer after you change the color. For  example:

                e.graphic.symbol.setColor("blue");

                graphicsLayer.redraw();