komalf

Multiple identify task & dojo deferredlist

Discussion created by komalf on Jul 12, 2011
Latest reply on Jul 13, 2011 by jgrayson-esristaff
I am trying to identify data from multiple map service and then merge in single array for further processing. The identify task works but when defCntyTask.addCallback is executed response.length return Undefined and nothing executes further.

I have tried to follow this post http://forums.esri.com/Thread.asp?c=158&f=2396&t=295896&mc=6#msgid924290

Can someone suggest how to correct this. Below is the code I used

Thanks

===

var defCntyTask = new dojo.Deferred();
var defwellTask = new dojo.Deferred();
var defpropTask = new dojo.Deferred();

functon createMapParam(evt)
{
CntyParam.tolerance = 5;
wellParam.tolerance = 5;
propParam.tolerance = 5;
CntyParam.returnGeometry = true;
wellParam.returnGeometry = true;
propParam.returnGeometry = true;
CntyParam.layerIds = [2];
wellParam.layerIds = [5];
propParam.layerIds = [5];
CntyParam.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
wellParam.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
propParam.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
map.graphics.clear();
CntyParam.geometry = evt.mapPoint;
wellParam.geometry = evt.mapPoint;
propParam.geometry = evt.mapPoint;
CntyParam.mapExtent = map.extent;
wellParam.mapExtent = map.extent;
propParam.mapExtent = map.extent;
}

function mspIdTask(evt)
{
defCntyTask = cntyIdTask.execute(CntyParam);
defwellTask = stnIdTask.execute(wellParam);
defpropTask = stnIdTask.execute(propParam);

defCntyTask.addCallback(function(response){console.log("Completed County Id task " + response.length);});
defwellTask.addCallback(function(response){console.log("Complete Well Id task " + response.length);});
defpropTask.addCallback(function(response){console.log("Complete Property Id task " + response.length);});

var defIdList = new dojo.DeferredList([defCntyTask,defwellTask,defpropTask]);

var idTaskComplete = function()
{
  Console.log("All Id task complete, Call merge results process ");
}

myDefIdList.addCallback(idTaskComplete);
}

Outcomes