Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9211249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:15:09+00:00 2026-06-18T01:15:09+00:00

I would like to fire the following two execute statements with one variable using

  • 0

I would like to fire the following two execute statements with one variable using javascript/dojo.

identifyTaskParcels.execute(identifyParams);
identifyTaskZoning.execute(identifyParams);

I have tried various variations of:

var deferred = [identifyTaskParcels.execute(identifyparams), identifyTaskZoning.execute(identifyParams)];

Is this something that is possible to do?

Edit

I’m trying to build a web mapping application that pulls info from 2 services and presents them in an infowindow/popup with feature info.

Its easy to do with 1 service, but I’m finding it hard to do with 2. Example of code that works:

EDIT 2

    dojo.require("esri.dijit.Popup"); //Infowindow

var identifyTask,identifyParams;    

      function mapReady(map){

       dojo.connect(map,"onClick",executeIdentifyTask);

       //create identify tasks and setup parameters 
       identifyTaskZoning = new esri.tasks.IdentifyTask("https:path/to/url/service");
       identifyTaskParcels = new esri.tasks.IdentifyTask("https://path/to/url/service");

            //Set Zoning Parameters
       identifyParamsZoning = new esri.tasks.IdentifyParameters();
       identifyParamsZoning.tolerance = 3;
       identifyParamsZoning.returnGeometry = true;
       identifyParamsZoning.layerIds = [0,1,2,3,4];
       identifyParamsZoning.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
       identifyParamsZoning.width  = map.width;
       identifyParamsZoning.height = map.height;
            //Set Parcel Parameters
       identifyParamsParcels = new esri.tasks.IdentifyParameters();
       identifyParamsParcels.tolerance = 3;
       identifyParamsParcels.returnGeometry = true;
       identifyParamsParcels.layerIds = [0,1,2,3,4];
       identifyParamsParcels.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
       identifyParamsParcels.width  = map.width;
       identifyParamsParcels.height = map.height;

       //resize the map when the browser resizes
       dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
      };

   function executeIdentifyTask(evt){
     identifyParamsParcels.geometry = evt.mapPoint;
     identifyParamsParcels.mapExtent = map.extent;
     var deferred = identifyTaskParcels.execute(identifyParamsParcels);
     deferred.addCallback(function(response){
       if (response.length > 0) {
//         console.log(response.length)
//         response is an array of identify result objects    
//         Let's return an array of features.
        return dojo.map(response, function(result){
          var feature = result.feature;
          feature.attributes.layerName = result.layerName;
          if(result.layerName === 'TaxParcel'){
              console.log(feature.attributes.NAME);
              var template = new esri.dijit.PopupTemplate({
                            title:"Parcels",
                            description:"<b>Parcel ID:</b> {Parcel Identification Number} <br/> <b>Address:</b> {Site Address}"
                            });
              feature.setInfoTemplate(template);
            }

                return feature;
        });
        }
      else {
          identifyParamsZoning.geometry = evt.mapPoint;
          identifyParamsZoning.mapExtent = map.extent;
          var deferred = identifyTaskZoning.execute(identifyParamsZoning);
          deferred.addCallback(function(response){
            // response is an array of identify result objects    
            // Let's return an array of features.
            return dojo.map(response, function(result){
              var feature = result.feature;
              feature.attributes.layerName = result.layerName;
            if(result.layerName === 'Zoning Classifications'){
              console.log(feature.attributes.NAME);
              var template = new esri.dijit.PopupTemplate({
                            title:"Zoning",
                            description:"<b>Zoning:</b> {Zoning Classification} <br/> <b>Description:</b> {Zoning Description}"
                            });
              feature.setInfoTemplate(template);
            }
            else if (result.layerName === 'Assisted Living Facilities'){
              var template = new esri.dijit.PopupTemplate({
                            title:"Assisted Living Facilities",
                            description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Applicant:</b> {BusinessApplicantName} <br/> <b>No. of Residents</b> {NbrResidents}"
                            });
              feature.setInfoTemplate(template);
            }
                        else if (result.layerName === 'Family Divisions'){
              var template = new esri.dijit.PopupTemplate({
                            title:"Family Divisions",
                            description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Project Number:</b> {project_nbr} </br> <b>Status:</b> {Status}"
                            });
              feature.setInfoTemplate(template);
            }
                        else if (result.layerName === 'Policy 120'){
              var template = new esri.dijit.PopupTemplate({
                            title:"Policy 120",
                            description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Business Name:</b> {BusinessName} </br> <b>Date of Letter:</b> {DateOfLetter}"
                            });
              feature.setInfoTemplate(template);
            }
                        else if (result.layerName === 'Zoning Changes'){
              var template = new esri.dijit.PopupTemplate({
                            title:"Zoning Changes",
                            description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Request Number:</b> {REQUEST_NBR} </br> <b>Property Owner:</b> {PROPERTY_OWNER}"
                            });
              feature.setInfoTemplate(template);
            }
            return feature;
            });
          });
      };
        map.infoWindow.setFeatures([deferred]);
        map.infoWindow.show(evt.mapPoint);          
      });
        map.infoWindow.setFeatures([deferred]);
        map.infoWindow.show(evt.mapPoint);      
      };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:15:10+00:00Added an answer on June 18, 2026 at 1:15 am

    I am not sure I understand the question, but it seems you need dojo/promise/all:

    require(["dojo/Deferred", "dojo/promise/all"], function(Deferred, all) {
    
        var taskParcels = new Deferred();
        var taskZoning = new Deferred();
    
        var deferred = all([taskParcels, taskZoning])
    
        deferred.then(function(result) {
            console.log(result);
        });
    
        taskParcels.resolve('hello');  
        setTimeout(function() {
            taskZoning.resolve('world');
        }, 1000);
    
    });
    

    See it in action: http://jsfiddle.net/phusick/S3b4B/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using a Google Chrome Extension, I would like to fire some event or somehow
I would like to fire the following evens: When submit button is clicked I
I would like to fire an UPDATE trigger only if a certain fields has
Instead of having nested callbacks in JS, I would like to fire and listen
I would like to have a Windows 2003 server fire a script to fire
I need to fire of a bunch of threads and would like to bring
I have two drag and drop lists as follows. I would also like the
How would you define a Quartz job, with the following requirements: It must fire
I would like a help from u all .I am using java and i
I'm using jQuery in my site and I would like to trigger certain actions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.