Set different opacity color fill for a single layer

378
4
08-09-2017 05:04 AM
Sai_AnandPeketi1
New Contributor III

Hello everyone,

                        I have a layer consist of 8 different categories for each category set a different color code and opacity in desktop and publish in the ArcGIS Server. It working fine in ArcGIS Online. Whenever I using the map services in ArcGIS API for JS the color code is fine, but the opacity is not working. It automatically set 0% transparency and 1  Opacity.

How can I set the different opacity for different categories in a single layer by the help of  ArcGIS API for JS?

Thanks for the help.

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

For that you need to look at VisualVariables for renderers:

https://developers.arcgis.com/javascript/3/jsapi/uniquevaluerenderer-amd.html#visualvariables 

Sai_AnandPeketi1
New Contributor III

Thanks for help Robert. Could give me a sample example.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

The attached zip has an example, it is a little complicated but you should be able to pull what you need from it:

Sai_AnandPeketi1
New Contributor III

Thank for help Robert. Let me check it. 

0 Kudos