Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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? Thanks in advance.

share|improve this question

1 Answer 1

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

 
discard

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.