<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic idenitifyTask.execute returning results in error callback in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/idenitifytask-execute-returning-results-in-error/m-p/276579#M25538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am seeing something strange in my IdentifyTask.execute. In the past I have not used the error callback on my IdentifyTask.execute calls just because I've never seen them fail. However, today was different. I set up a identify task on a map service and set up the parameterslike so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;identifyTask = new IdentifyTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FdomainName%2Farcgis%2Frest%2Fservices%2FWestNileVirus%2FSanDiego_EVSTraps%2FMapServer" rel="nofollow" target="_blank"&gt;http://domainName/arcgis/rest/services/test/SD/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; identifyParams = new IdentifyParameters();&lt;BR /&gt; identifyParams.tolerance = 3;&lt;BR /&gt; identifyParams.returnGeometry = true;&lt;BR /&gt; identifyParams.layerIds = [4];&lt;BR /&gt; identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;&lt;BR /&gt; identifyParams.width = map.width;&lt;BR /&gt; identifyParams.height = map.height;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I called the identifyTask&amp;nbsp;on map click, nothing happened. No error or anything. So I brought in my good friend errorCallback to see what was going on. To my surprise, the error callback reported a beautifully structured response - the one that I had expected to see in in my successCallback instead of an&amp;nbsp;error. And this return was perfectly structured geometry, attributes and everything. It was perfect. Here is what&amp;nbsp;I'm using for the execute task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function executeIdentifyTask(mapPoint) {&lt;BR /&gt; require(["dojo/_base/array",&lt;BR /&gt; "dojo/on"], function(arrayUtils, on){&lt;BR /&gt; console.log("event.mapPoint: " + mapPoint);&lt;BR /&gt; identifyParams.geometry = mapPoint;&lt;BR /&gt; identifyParams.mapExtent = map.extent;&lt;BR /&gt; var deferred = identifyTask.execute(identifyParams).addCallback(function (response) {&lt;BR /&gt; return arrayUtils.map(response, function (result) {&lt;BR /&gt; var feature = result.feature;&lt;BR /&gt; var layerName = result.layerName;&lt;BR /&gt; feature.attributes.layerName = layerName;&lt;BR /&gt; var bgTemplate = new InfoTemplate("", "Name: ${Name}");&lt;BR /&gt; feature.setInfoTemplate(bgTemplate);&lt;BR /&gt; return feature;&lt;BR /&gt; });&lt;BR /&gt; }, function (error){&lt;BR /&gt; console.log("error: " + JSON.stringify(error));&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; console.log("deferred: " + JSON.stringify(deferred))&lt;BR /&gt; map.infoWindow.setFeatures([deferred]);&lt;BR /&gt; map.infoWindow.show(mapPoint);&lt;BR /&gt; });&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone seen anything like this before? It is driving me crazy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks, Tyler&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Nov 2016 21:52:42 GMT</pubDate>
    <dc:creator>TylerWaring</dc:creator>
    <dc:date>2016-11-15T21:52:42Z</dc:date>
    <item>
      <title>idenitifyTask.execute returning results in error callback</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/idenitifytask-execute-returning-results-in-error/m-p/276579#M25538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am seeing something strange in my IdentifyTask.execute. In the past I have not used the error callback on my IdentifyTask.execute calls just because I've never seen them fail. However, today was different. I set up a identify task on a map service and set up the parameterslike so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;identifyTask = new IdentifyTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FdomainName%2Farcgis%2Frest%2Fservices%2FWestNileVirus%2FSanDiego_EVSTraps%2FMapServer" rel="nofollow" target="_blank"&gt;http://domainName/arcgis/rest/services/test/SD/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; identifyParams = new IdentifyParameters();&lt;BR /&gt; identifyParams.tolerance = 3;&lt;BR /&gt; identifyParams.returnGeometry = true;&lt;BR /&gt; identifyParams.layerIds = [4];&lt;BR /&gt; identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;&lt;BR /&gt; identifyParams.width = map.width;&lt;BR /&gt; identifyParams.height = map.height;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I called the identifyTask&amp;nbsp;on map click, nothing happened. No error or anything. So I brought in my good friend errorCallback to see what was going on. To my surprise, the error callback reported a beautifully structured response - the one that I had expected to see in in my successCallback instead of an&amp;nbsp;error. And this return was perfectly structured geometry, attributes and everything. It was perfect. Here is what&amp;nbsp;I'm using for the execute task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function executeIdentifyTask(mapPoint) {&lt;BR /&gt; require(["dojo/_base/array",&lt;BR /&gt; "dojo/on"], function(arrayUtils, on){&lt;BR /&gt; console.log("event.mapPoint: " + mapPoint);&lt;BR /&gt; identifyParams.geometry = mapPoint;&lt;BR /&gt; identifyParams.mapExtent = map.extent;&lt;BR /&gt; var deferred = identifyTask.execute(identifyParams).addCallback(function (response) {&lt;BR /&gt; return arrayUtils.map(response, function (result) {&lt;BR /&gt; var feature = result.feature;&lt;BR /&gt; var layerName = result.layerName;&lt;BR /&gt; feature.attributes.layerName = layerName;&lt;BR /&gt; var bgTemplate = new InfoTemplate("", "Name: ${Name}");&lt;BR /&gt; feature.setInfoTemplate(bgTemplate);&lt;BR /&gt; return feature;&lt;BR /&gt; });&lt;BR /&gt; }, function (error){&lt;BR /&gt; console.log("error: " + JSON.stringify(error));&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; console.log("deferred: " + JSON.stringify(deferred))&lt;BR /&gt; map.infoWindow.setFeatures([deferred]);&lt;BR /&gt; map.infoWindow.show(mapPoint);&lt;BR /&gt; });&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone seen anything like this before? It is driving me crazy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks, Tyler&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 21:52:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/idenitifytask-execute-returning-results-in-error/m-p/276579#M25538</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2016-11-15T21:52:42Z</dc:date>
    </item>
  </channel>
</rss>

