Transparency With Dynamic Map

568
3
03-30-2011 04:41 AM
PatrickAdams
New Contributor
I am using the Java api. In my application I use a mapBean with the dynamic map enabled to display my raster images. These images contain a alpha channel as much of the image is transparent. When viewed in normal mode (i.e. not dynamic mode) these images display as expected, with the images below the transparency being visible through the transparent areas. However when I switch to dynamic map all of the areas which should be transparent are instead filled in with white.

dynamic mode


non-Dynamic mode


This could be due to how I set up the DynamicCacheManager for the layers. This is done on loading the map document using the following code:

for (int i = 0; i < map.getLayerCount(); i++)
{
      ILayer layer = map.getLayer(i);

      IDynamicCacheLayerManager cacheLayerManager = new DynamicCacheLayerManager();
      cacheLayerManager.init(map, layer);
      cacheLayerManager.setProgressiveDrawingLevels(2);
      cacheLayerManager.setProgressiveFetchingLevels(2);
}

Any help/suggestions on how to keep the transparency while in dynamic mode would be much appreciated.
0 Kudos
3 Replies
PatrickAdams
New Contributor
Further investigation has revealed this to be something to do with Group Layers. All of my images with transparency were contained in a Group Layer, and the background image was in a seperate group layer. When I remove put all the images in one single group layer transparency works as expected.
0 Kudos
by Anonymous User
Not applicable
Original User: hazelton_glenn

hi Patrick,
can you explain this again please? i have layers that are set with transpaceny in the mxd. they are in a group in the mxd. when i publish this and view it in the flex viewer they are not transparent.
the background of the mxd is set to 123 so it will be visible with the caches.
are you saying i should have all the layers with tranparency in one grouplayer collection?

Further investigation has revealed this to be something to do with Group Layers. All of my images with transparency were contained in a Group Layer, and the background image was in a seperate group layer. When I remove put all the images in one single group layer transparency works as expected.
0 Kudos
PatrickAdams
New Contributor
Its actually worse than that, I found that in a dynamic display transparency only works between layers which are in the same group. So both the layers with transparency, and the layers beneath those with transparency all have to be in the same group.
0 Kudos