[GIS] ArcGIS server 9.3.1 Javascript API via REST : Transparency issue

arcgis-javascript-apiarcgis-rest-apiarcgis-server

I have two map services , one is tiled service returns a satellite image , and the other is dynamic displays the roads ,POIs and Parcels.

I'm trying to make the dynamic one shows the roads only above the satellite image , but i'm always getting white background with the roads and it covers the satellite image.

Here's my code :

map = new esri.Map("mapDiv");
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://URL_TO_SATELLITE/MapServer");
map.addLayer(basemap);

var imageParameters = new esri.layers.ImageParameters();
imageParameters.format = "png24";
imageParameters.height=100;
imageParameters.width=100;  
imageParameters.layerIds=[7]; // Only Roads !
imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;
imageParameters.transparent=true;   

var entrmap = new esri.layers.ArcGISDynamicMapServiceLayer("http://URL_TO_DYNAMIC/MapServer",
              {"imageParameters":imageParameters}); 

map.addLayer(entrmap);

Thank you for your help 🙂

Best Answer

If you set transparency only on one layer in your ArcMap file you should save it as MSD () and NOT mxd and in javascript init ArcGISDynamicMapServiceLayer with

imageParameters.format = "png32";

Here are some links to similair posts on ESRI forum:

http://forums.arcgis.com/threads/27413-layer-transparency-not-working

http://forums.arcgis.com/threads/10011-dynamic-layer-transparency