AnsweredAssumed Answered

Problem with Identify on a DynamicMapServiceLayer with a class break renderer applied

Question asked by tomrip on Mar 29, 2016
Latest reply on Apr 5, 2016 by tomrip

I am seeing some unexpected behavior when my code performs an Identify operation against a DynamicMapServiceLayer that has a class breaks renderer applied to it. My code is using the default Identify operation, i.e. map.setInfoWindowOnClick(true).

 

The 'unexpected behavior' is that no feature(s) from the dynamic map service is returned in the Identify features result set when i have set a class breaks renderer on the dynamic map service. But, when i use just the default renderer, the Identify behaves as expected - a feature is returned from the Identify operation.

 

One potentially interesting bit of info is that the dynamic map service URL is a map service created as part of a geoprocessing service (that may just be a red herring but thought i would include it just in case......)

 

Here's a code snippet:

var vizLayer = new ArcGISDynamicMapServiceLayer(url, { "id": vLayer.id });

var renderer = new ClassBreaksRenderer(genericSymbol, "vizRender");

renderer.addBreak({minValue: -10, maxValue: 20, symbol: LowSymbol, label: "0 - 20%"});

renderer.addBreak({minValue: 20, maxValue: 40, symbol: MediumLowSymbol, label: "20 - 40%"});

renderer.addBreak({minValue: 40, maxValue: 60, symbol: MediumSymbol, label: "40 - 60%"});

renderer.addBreak({minValue: 60, maxValue: 80, symbol: MediumHighSymbol, label: "60 - 80%"});

renderer.addBreak({minValue: 80, maxValue: 110, symbol: HighSymbol, label: "80 - 100%"});

 

var optionsArray = [];

var drawingOptions = new LayerDrawingOptions();

drawingOptions.renderer = renderer;

optionsArray[0] = drawingOptions;

vizLayer.setLayerDrawingOptions(optionsArray);

 

When I comment out the last line of code, (vizLayer.setLayerDrawingOptions(optionsArray)) and leave everything else the same, the Identify returns a feature(s) from the dynamic map service.  However, if i leave the line of code in, the Identify returns no features from the dynamic map service.

 

Is that the expected behavior? is there a way i can do an Identify against a dynamic service with a renderer applied?

 

Thank you.

Outcomes