i have 5 circle markers with black color , now i want to change the color of 1 marker based upon the condition to red using arcgis API

799
1
10-24-2016 12:22 AM
shivacharan
New Contributor

I have an app where it will display 10 dots with same color, now based upon some condition I want to change the color of one dot

0 Kudos
1 Reply
BillChappell
Occasional Contributor II

Not 100% sure  of what you are asking, but here is my guess.

I have a featurelayer called "operationsPointLayer" and in it's attributes table I have a field called "VERIFIED", it has 2 possible values Y or N. I draw the Y as green and N as red.

var recordRenderer = new UniqueValueRenderer(defaultSymbol, "VERIFIED");

recordRenderer.addValue("Y", new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 8, null, new Color([0,204,0])));

recordRenderer.addValue("N", new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 8, null, new Color([255,0,0])));

operationsPointLayer.setRenderer(recordRenderer);

When I edit the data and change N to Y the points change color.

Or are you asking for the points to change color when selected in the map? In that case here is an example.

Select with Feature Layer | ArcGIS API for JavaScript 3.19 

0 Kudos