AnsweredAssumed Answered

esri.request doubt for legend creation

Question asked by svikram86 on Apr 9, 2014
Latest reply on Apr 9, 2014 by svikram86
Hello all,

I am creating legend dynamically using below code . maplayers_config contains list of url's for the map service . In the response how do I know for which map service I am getting the response . Can anybody help me with this . Thanks

for (var mapcount = 0; mapcount <= maplayers_config.length - 1; mapcount++) {
   /*var url = maplayers_config[mapcount].url + '/legend';*/
   var url = 'http://utility.arcgis.com/sharing/tools/legend';
        url = url + '?soapUrl=' + escape(maplayers_config[mapcount].url);
      var handle = esriRequest({
        url: url,
   content: { f: "json" },
        callbackParamName: 'callback'
      });
  
 
     handle.then(
  function(response,io) {
    console.log("Success: ", response);
console.log("Success: ", io);
a_test = response;
  },
function(error) {
    console.log("Error: ", error);
  });
  }
   });

Outcomes