I have a workflow that results in generating a report for certain features with a column name. Goal is to return only results from feature layers in my map service which have a specified column name. User clicks a location on the map service and the queryTask begins... I'm trying to move my coding format to AMD and am using JSAPI 3.7 with 10.2 map service. I've included a JSFiddle link for the intent on sharing the code. Hope that's okay and thanks in advance! JSFiddle Link


In a general sense, you'll need to list out all the visible layers for the extent on the map and then query each layer with querytask using the GIS_LINK field. You probably already know this.

From what you describe, the trick is to know when all the queryTasks have finished. You'll want to check out the dojo/promise/all api. This will allow you to move forward with the results from all the individual queryTasks knowing that they've finished. The ones that don't have the GIS_LINK field are going to fail or come back empty -- so you'll have to check each status in the results. (DeferredList used to be the way to do this.)



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.