Select to view content in your preferred language

Dynamic layer transparency in custom JSAPI web app

1008
3
02-23-2011 10:17 PM
RichardKaufholz
Deactivated User
Hi there,

I have a custom web application (JSAPI) consuming a web service from ArcGIS Server 10. In that service there are some polygon layers with a transparency value set > 0% (i.e. semi-transparent). However, when that service is published in the application, the layers are shown at 0% transparency (i.e. opaque).

I have published the same service in a web application built from the ArcGIS Server Manager, and the transparency is honored.

Can someone explain how to replicate that behavior in my own application?

Thanks!
Richard.
0 Kudos
3 Replies
HemingZhu
Frequent Contributor
Hi there,

I have a custom web application (JSAPI) consuming a web service from ArcGIS Server 10. In that service there are some polygon layers with a transparency value set > 0% (i.e. semi-transparent). However, when that service is published in the application, the layers are shown at 0% transparency (i.e. opaque).

I have published the same service in a web application built from the ArcGIS Server Manager, and the transparency is honored.

Can someone explain how to replicate that behavior in my own application?

Thanks!
Richard.

You can use setOpacity method (in its supper class: Layer  to set up the transparency. However. This method applies for the whole layer. you might have to find a workaround to achieve your goal.
0 Kudos
JarkkoKuoppamäki
Occasional Contributor
Richard, were you able to find a solution to this?

While setting the transparency in the JavaScript code would probably work, it would require changes to the code every time when layers are removed from or added to the service (the mxd).
0 Kudos
DonnyVelazquez
Frequent Contributor
This is 2 years old I see the same problem. JSAPI is not honoring transparency setting in map service.
0 Kudos