Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Feature Collection consisting of features having id, color_code, etc as attributes. I have to render this feature with the color in the color_code attribute. Is this possible and please suggest some links?

share|improve this question
up vote 2 down vote accepted

Yes, it's possible. You should build and use a renderer, probably a unique value renderer.

Before adding your feature layer to a map, loop through your features and build symbols from your color codes and add them to a renderer. Then use setRenderer to specify your renderer for your layer. The unique value renderer sample will probably be helpful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.