Renderer for dynamic workspace raster (API 3.x)

107
0
09-21-2019 05:48 AM
DavideLimosani
Occasional Contributor II

Hello,

I am working with map services in a dynamic workspace and API 3.x.

Here i have my code to add layers to my map:

var dataSource = new RasterDataSource();
dataSource.workspaceId = workSpaceId;
dataSource.dataSourceName = mydataSourceName ;
var layerSource = new LayerDataSource();
layerSource.dataSource = dataSource;

var dynamicLayerInfos = [];

var dynamicLayerInfo = new DynamicLayerInfo();
dynamicLayerInfo.id = 0;
dynamicLayerInfo.source = layerSource;
dynamicLayerInfos.push(dynamicLayerInfo);
var layer= new ArcGISDynamicMapServiceLayer(myurl)

map.addLayer(layer);

this is working perfectly. 

Now I need to set a renderer for my layer. I think i should do something like this:

var layerDrawingOptions = [];
var layerDrawingOption = new LayerDrawingOptions();

layerDrawingOption.renderer = ????
layerDrawingOptions.push(layerDrawingOption);

layer.setLayerDrawingOptions(layerDrawingOptions);

But i don't know what class of renderer i should use for rasters.

ClassBreaksRenderer?UniqueValueRenderer?

Any help?

Thanks

0 Kudos
0 Replies