All of the polygons below are produced with the same color settings with 125 as the alpha value,
but you can see the result is different in each polygon.
Any way to get a consistent color with the same opacity in each? I did double check and I'm pretty sure none of the polygons overlap.
Solved! Go to Solution.
I figured it out. I was looping through the array of shapes from my database and conditionally only showing some of them based on filters on the page. However, I neglected to include the "map.graphics.add(new Graphic(poly, sym));" call inside the condition so it was adding empty Graphic entries which for some reason was causing the color inconsistencies. Thanks to @Kristian Ekenes as I discovered this in trying to create a sample of the code to post for debugging. Thanks to everyone for your input, hopefully this post will help someone else debug this issue in the future if they make the same mistake!
Andrew,
Are any of the polygons duplicated in the json?
No duplicates, just double checked.
Which API version are you using?
I'm not able to independently verify this in a simple test app. I would need to see a sample with more of your code in context. Are you able to share this in jsbin or some other way?
Andrew,
The range for alpha should be a value from 0 to 1. Maybe that is creating your inconsistency?
Regards,
Tom
When loading a symbol from JSON the range is 0-255.
See ArcGIS REST API.
I figured it out. I was looping through the array of shapes from my database and conditionally only showing some of them based on filters on the page. However, I neglected to include the "map.graphics.add(new Graphic(poly, sym));" call inside the condition so it was adding empty Graphic entries which for some reason was causing the color inconsistencies. Thanks to @Kristian Ekenes as I discovered this in trying to create a sample of the code to post for debugging. Thanks to everyone for your input, hopefully this post will help someone else debug this issue in the future if they make the same mistake!