doncatanzaro

Dynamic control of symbol

Discussion created by doncatanzaro on Jan 18, 2012
Latest reply on Jan 20, 2012 by doncatanzaro
Hi All,

I have a Javascript application that currently is consuming a vector map via ArcGIS Server (Feature Layer). 

The application dynamically changes which polygons get colored (yellow vs grey) based on some user interaction but my implementation is kind of a kludge.  I build an array in Javascript where one column is the unique value for each polygon and the other is whether I want it yellow or grey (e.g. 1, 0).  My custom renderer then loops through the polygons setting the renderer.addValue to the color I want based on a if statement (0 or 1).

This is not terribly efficient but it worked.

I need this now to interact with some data stored in the fields of my feature layer (it did not previously) so I figured I would make whole thing smarter

So the user might say, all polygons with Field5 > 22 are yellow the rest are grey, but later they might want to see what happens if the criteria changes to say Field5 > 122.

The issue I am having is how to link the fields in my feature layer with the symbol and I am having trouble conceptualizing how I would be able to access the field data for each polygon to allow me to do some math functions.

Any directions, and links would be greatly appreciated.

Outcomes