ArcGISDynamicMapServiceLayer transparency

2628
3
10-15-2012 10:07 AM
RobertHauck
New Contributor
I have several layers inside a ArcGISDynamicMapServiceLayer that are set to be transparent in its .msd.  They are showing up as opaque in android.  The same service shows the layers as transparent in the javascript api by setting imageParameters.format = "png32" for the ArcGISDynamicMapServiceLayer.

Is is possible to do this in android? I do not see anything similar to imageParameters for a ArcGISDynamicMapServiceLayer in android.

Thank you
0 Kudos
3 Replies
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
Are you saying that the Android API is not recognizing the opacity of individual layers within your map service?  So they all come in as completely opaque? (Just want to make sure I understand you correctly)

I don't know of, or if there is even a way, to set the output image format in Android.  Does the REST endpoint of your Dyn. Map Service support/allow for output PNG? I would imagine it *should* work.  I haven't had a use case yet where I need to render layer opacity as it pertains to dynamic map services.  You could try iterating through all of the layers in your Dynamic Map Service and call the getOpacity(); method and see what returns.
0 Kudos
RobertHauck
New Contributor
Are you saying that the Android API is not recognizing the opacity of individual layers within your map service?  So they all come in as completely opaque? (Just want to make sure I understand you correctly)


Correct, the API is displaying individual layers inside the dynamic map service as opaque.  The service supports PNG export but I don't see anywhere in the android API to request PNG output as I had do in the javasript API to get the layer transparencies to work.


You could try iterating through all of the layers in your Dynamic Map Service and call the getOpacity(); method and see what returns.


As far as I can tell the the getOpacity() & setOpacity() methods only work on the entire ArcGISDynamicMapServiceLayer.

I'm probably missing something. Thank you for the input!
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
Check out ArcGISDynamicmapServiceLayer.getLayers();  This will return an array of ArcGISLayerInfo[];  From that, you can try to iterate through all the layers in the array, casting them to a Layer object then call the Layer.getOpacity(); method.

I haven't tested it, but it might be worth a try.
0 Kudos