Here's an example of using a DeferredList to await for the results of two different IdentifyTasks.
Kelly,
I am using the deferred method for identify task. i have two services i would like to create tasks for and use info templates for each sub layer. The problem i am having is that it will only identify the last service in the code. in my main application it will identify the 1st layer i turn on that is in the first service. however, when i turn on layers in the second service it will no longer identify layers in the first service.
I created jsfiddle that is a simplified version of my application. Do you have any idea what i am doing wrong here?
Also, I am using this method so i can identify grids/rasters...
Robert,
There's only one info window so whichever identify finishes last will overwrite the first one with the content. I think instead you'll want to use dojo/promises/all to determine when both identify tasks have finished and then set the info window content. We have a sample in the help that shows how to work with multiple deferreds and dojo/promises/all here:
Manage results from multiple queries | ArcGIS API for JavaScript
Thanks. I will check out that example and let you know if i get it figured out. Thanks!
Kelly,
Quick question:
Do i keep the identify tasks set up the way i have them and then use the promise?
Here's a fiddle that shows one way to accomplish this:
Kelly,
Thanks so much. This is perfect. once again you have help me get over a major frustrating wall!