<?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 Re: Strange Issue with the IdentifyTask in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572514#M53476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wow, hzhu, that really is wacky. I hoped that what you said was the problem with my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; task.execute(params);
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(task, "onComplete", function(idResults) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyInfoWin(idResults, evt);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide the loading bar when a result is found
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(task, "onError", function(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("doIdentify: (" + err.name + ") " + err.message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, I still get the same error under the same circumstances.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:39:02 GMT</pubDate>
    <dc:creator>DanielYim</dc:creator>
    <dc:date>2021-12-12T00:39:02Z</dc:date>
    <item>
      <title>Strange Issue with the IdentifyTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572511#M53473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I try to identify a feature, the IdentifyTask's execute function is invoking an error that simply contains the message "Unable to complete operation."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The strange thing is, this identify function works as it should when I use it at either the map's full extent or a specific extent of a feature (when I zoom to a feature via the results in a Datagrid), but once I pan the map even slightly out of that specific extent, the IdentifyTask throws that error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is listed in the following. It's a loose interpretation of the "Identify features on a map" sample provided by ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;doIdentify = function(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide the previous results
&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var task = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var params = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; task = new esri.tasks.IdentifyTask(url.baseMap);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; params = new esri.tasks.IdentifyParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.tolerance = 4;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.layerIds = [3, 4, 5, 6];
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.width = myMap.width;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.height = myMap.height;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.geometry = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.mapExtent = myMap.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; task.execute(params, function(idResults) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyInfoWin(idResults, evt);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("doIdentify: (" + err.name + ") " + err.message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
};&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I consider myself well-acquainted with the ArcGIS JS API, but I have been staring at this problem for much too long without seeking help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 21:10:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572511#M53473</guid>
      <dc:creator>DanielYim</dc:creator>
      <dc:date>2011-02-24T21:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Issue with the IdentifyTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572512#M53474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When I try to identify a feature, the IdentifyTask's execute function is invoking an error that simply contains the message "Unable to complete operation."&lt;BR /&gt;&lt;BR /&gt;The strange thing is, this identify function works as it should when I use it at either the map's full extent or a specific extent of a feature (when I zoom to a feature via the results in a Datagrid), but once I pan the map even slightly out of that specific extent, the IdentifyTask throws that error.&lt;BR /&gt;&lt;BR /&gt;My code is listed in the following. It's a loose interpretation of the "Identify features on a map" sample provided by ArcGIS.&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;doIdentify = function(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide the previous results
&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var task = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var params = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; task = new esri.tasks.IdentifyTask(url.baseMap);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; params = new esri.tasks.IdentifyParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.tolerance = 4;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.layerIds = [3, 4, 5, 6];
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.width = myMap.width;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.height = myMap.height;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.geometry = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; params.mapExtent = myMap.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; task.execute(params, function(idResults) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyInfoWin(idResults, evt);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("doIdentify: (" + err.name + ") " + err.message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
};&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I consider myself well-acquainted with the ArcGIS JS API, but I have been staring at this problem for much too long without seeking help.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Take out this optional function function(err) from your code and try again. Believe it or not sometime this function do harm that it do good.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572512#M53474</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-12T00:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Issue with the IdentifyTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572513#M53475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Take out this optional function function(err) from your code and try again. Believe it or not sometime this function do harm that it do good.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a follow up for what i was saying. I found out that sometimes onComplete and onError both fired up if you put both in execute method. if i put them seperately using dojo.connect, it works just fine. I could not figure out why.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Feb 2011 12:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572513#M53475</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-02-25T12:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Issue with the IdentifyTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572514#M53476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wow, hzhu, that really is wacky. I hoped that what you said was the problem with my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; task.execute(params);
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(task, "onComplete", function(idResults) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyInfoWin(idResults, evt);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hide the loading bar when a result is found
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(task, "onError", function(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("doIdentify: (" + err.name + ") " + err.message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, I still get the same error under the same circumstances.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572514#M53476</guid>
      <dc:creator>DanielYim</dc:creator>
      <dc:date>2021-12-12T00:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Issue with the IdentifyTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572515#M53477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I finally figured it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using a bad Extent object as an initial extent for my map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // This is entirely the WRONG way to declare an extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; var startExtent = new esri.geometry.Extent({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin: -107.62971356312966,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin: 25.850355124455604,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax: -92.35392362656452,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax: 36.59093275985384,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spatialReference: {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wkid: "4269"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap = new esri.Map("mapDiv", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent: startExtent,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logo: false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slider: false
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;where&lt;/SPAN&gt;&lt;SPAN&gt; I got that extent format from, but it's wrong and using that format will mess with your application, particularly IdentifyTask in my case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the following format instead, as per &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/extent.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;the JS API&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; startExtent = new esri.geometry.Extent(-101.120185812004, 34.39538449192201, -100.983017186634, 34.49182927651549, new esri.SpatialReference({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wkid: 4269
&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for reading.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:39:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/strange-issue-with-the-identifytask/m-p/572515#M53477</guid>
      <dc:creator>DanielYim</dc:creator>
      <dc:date>2021-12-12T00:39:04Z</dc:date>
    </item>
  </channel>
</rss>

