AnsweredAssumed Answered

Trying to use ArcGISDynamicMapServiceLayer to display RasterDataSource

Question asked by myESRIUName on Jun 22, 2016
Latest reply on Dec 1, 2016 by s.offermannconterra-de-esridist

Using ESRI JSAPI 3.16 and ArcGIS Server 10.4, I'm trying to work out how to display a user-specified TIF using a dynamic workspace associated with a ArcGISDynamicMapServiceLayer. So far, no luck. When I look at the REST request that is being submitted when I add my defined layer to the map, none of the dynamic information is being passed along so I end up with a blank image returned.



I've tried various convolutions of JavaScript code to do this. At the moment, my code is like this:

        var rasterDataSource = new RasterDataSource();

        rasterDataSource.workspaceId = "rasters";

        rasterDataSource.dataSourceName = "cr_rc.tif";


        var layerDataSource = new LayerDataSource();

        layerDataSource.dataSource = rasterDataSource;

        layerDataSource.type = "raster"


        var dynamicLayerInfo = new DynamicLayerInfo();

        dynamicLayerInfo.source = layerDataSource;


        var rasterLayer = new ArcGISDynamicMapServiceLayer(










The export request that is sent by the map.addLayer functionality is:




Now, I can get the image I want with an export request that looks like this (decoded here, of course):





    "type": "dataLayer",

    "dataSource": {

      "type": "raster",


      "dataSourceName": "cr_rc.tif"






I just can't figure out how to get the JSAPI to tack on the dynamicLayers parameter to its export request. At least, I think that's my only problem.


Can anyone provide any suggestions regarding what I am missing or doing incorrectly here?