I need to edit my web app so that I can change the attribute value defining the point symbols in a set of dynamic map service layers. The points are symbolized by size and color.
I am not sure if this is possible? The closest example I have found is here - but in this example they are using class breaks only. It appears I can also use a UniqueValueDefinition instead of the ClassBreaksDefinition used in the example as a parameter of the GenerateRendererTask, but in the API I only see a color ramp available (no change in size). I would prefer to have defined colors and defined sizes, using the same values, with the ability to switch the defining attribute from the web interface, as in the example I included. This is an existing application, so I need to maintain the use of dynamic map service layers (I can't use feature layers).
I see that a Unique Value renderer may be used for this, but that appears to only work for feature layers.
Any ideas, examples? Thanks in advance.
Solved! Go to Solution.
I found that I could in fact use the UniqueValueRenderer class with a dynamic layer. I create a renderer with that class, then use its 'addValue' method to define individual markers, each with their own sizes and colors, for a specific attribute's value, then pas these renderer properties to a LayerDrawingOptions object. I then use setLayerDrawingOptions on the specified layer to set these drawing options.
So far it seems to work but I have only tested very small datasets.
I found that I could in fact use the UniqueValueRenderer class with a dynamic layer. I create a renderer with that class, then use its 'addValue' method to define individual markers, each with their own sizes and colors, for a specific attribute's value, then pas these renderer properties to a LayerDrawingOptions object. I then use setLayerDrawingOptions on the specified layer to set these drawing options.
So far it seems to work but I have only tested very small datasets.