Select to view content in your preferred language

ArcGISDynamicMapServiceLayer - Shaging Polygons in JavaScript Based on Ranges

593
1
09-04-2011 07:31 PM
MattBrunsdon
New Contributor
Hey Guys,

I'm new to the API, I have successfully added a ArcGISDynamicMapServiceLayer of postcode boundaries to my map.

I was wondering if there is a way of changing the color of these polygons in the JavaScript based on a range of data that is stored in the service? For example: all polygons with a feature attribute "income" and a  value of "1" are shaded red.

I know this is probably possible at the service level, however I would prefer not to have to create a new service for each range of values that I need to shade the polygons for.

Is that possible at all?

Thanks for your help!
0 Kudos
1 Reply
StephenLead
Regular Contributor III
Matt,

As far as I know, you can't do this with a Dynamic layer.

Instead, you could add your polygons as a Feature layer.

A feature layer can have a renderer, which would allow you to specify your desired class breaks.

Steve
0 Kudos