<?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 QueryTask and IdentifyTask replacement in Arcgis version 4.27 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-identifytask-replacement-in-arcgis/m-p/1308117#M81686</link>
    <description>&lt;P&gt;I'm about to update Arcgis from version 3 to 4.27 but don't have any idea how can I convert the below function:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;function InfWindow(point, screenPoint) {&lt;BR /&gt;var qtLGA = new esri.tasks.QueryTask(WaterConnectMapServerURL + "/16/");&lt;BR /&gt;var qLGA = new esri.tasks.Query();&lt;/P&gt;&lt;P&gt;qtLGA.requestTimeout = 180;&lt;BR /&gt;qLGA.requestTimeout = 180;&lt;/P&gt;&lt;P&gt;qLGA.returnGeometry = false;&lt;BR /&gt;qLGA.outFields = ["ABBNAME"];&lt;BR /&gt;qLGA.geometry = point;&lt;BR /&gt;var qLGADefer = qtLGA.execute(qLGA);&lt;/P&gt;&lt;P&gt;var identifyTask = new esri.tasks.IdentifyTask(FloodMapServerURL);&lt;BR /&gt;identifyTask.requestTimeout = 180;&lt;BR /&gt;var identifyParams = new esri.tasks.IdentifyParameters();&lt;BR /&gt;identifyParams.tolerance = 0;&lt;BR /&gt;identifyParams.returnGeometry = false;&lt;BR /&gt;identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;&lt;BR /&gt;identifyParams.width = map.width;&lt;BR /&gt;identifyParams.height = map.height;&lt;BR /&gt;identifyParams.geometry = point;&lt;BR /&gt;identifyParams.mapExtent = map.extent;&lt;BR /&gt;var identifyDefer = identifyTask.execute(identifyParams);&lt;/P&gt;&lt;P&gt;map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));&lt;BR /&gt;map.infoWindow.setTitle("Loading...");&lt;BR /&gt;map.infoWindow.setContent("");&lt;/P&gt;&lt;P&gt;var promises = new all([qLGADefer, identifyDefer]);&lt;BR /&gt;promises.always(function (results) {&lt;BR /&gt;var infContent = [];&lt;BR /&gt;infContent.push("&amp;lt;table class='tblInfoWindow'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;tr class='tblInfoWindowTrHeader'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th&amp;gt;Study&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th class='th-Internal-Pad'&amp;gt;Layer&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th class='th-Internal-Pad'&amp;gt;Depth&amp;amp;nbsp;Range&amp;amp;nbsp;(m)&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;/tr&amp;gt;");&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; results.length; i++) {&lt;BR /&gt;if (results[i].features != null) {&lt;BR /&gt;if (jQuery.isEmptyObject(results[i].features)) {&lt;BR /&gt;map.infoWindow.setTitle("Outside Local Council Area");&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;map.infoWindow.setTitle(results[i].features[0].attributes.ABBNAME);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if ($.isArray(results[i])) {&lt;BR /&gt;if (results[i].length == 0) {&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;for (var j = 0; j &amp;lt; results[i].length; j++) {&lt;BR /&gt;infContent.push("&amp;lt;tr class='tblInfoWindowTrData'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;td&amp;gt;" + IDtoLabel[results[i][j].layerId] + "&amp;lt;/td&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;&amp;lt;a title='Turn on layer' href='javascript&amp;amp;colon;void(0)' class='LayerLink " + results[i][j].layerId + "'&amp;gt;" + results[i][j].layerName + "&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;");&lt;BR /&gt;if (results[i][j].displayFieldName.toUpperCase().indexOf("RANGE") != -1)&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;" + results[i][j].value + "&amp;lt;/td&amp;gt;");&lt;BR /&gt;else&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;Extent only&amp;lt;/td&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;/tr&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;infContent.push("&amp;lt;/table&amp;gt;");&lt;BR /&gt;map.infoWindow.resize(400, 200);&lt;BR /&gt;var infContentJoined = infContent.join('');&lt;BR /&gt;if (infContentJoined.indexOf("tblInfoWindowTrData") == -1) {&lt;BR /&gt;map.infoWindow.setContent("No study data available at this location. Searching nearby...");&lt;BR /&gt;SearchWithTolerance(point);&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;map.infoWindow.setContent(infContentJoined);&lt;BR /&gt;$(".tblInfoWindow").find("img.pdfIcon_layer").click(function () {&lt;BR /&gt;var layerID = $(this).attr("id").replace("img_layer", "");&lt;BR /&gt;OpenPDFLink(layerID);&lt;BR /&gt;});&lt;BR /&gt;$(".tblInfoWindow").find("img.Question").click(function () {&lt;BR /&gt;var layerID = $(this).attr("id").replace("question_layer", "");&lt;BR /&gt;var layerName = $.trim($(this).parent().text());&lt;BR /&gt;OpenQuestionLink(layerID, layerName);&lt;BR /&gt;});&lt;BR /&gt;$(".LayerLink").click(function () {&lt;BR /&gt;var $tree2 = $("#tree2");&lt;BR /&gt;var layerId = parseInt($(this).attr("class").replace("LayerLink ", ""), 10);&lt;BR /&gt;var node = $tree2.tree('getNodeById', layerId);&lt;BR /&gt;if (node) {&lt;BR /&gt;$tree2.tree('openNode', node.parent, false);&lt;BR /&gt;$tree2.tree('selectNode', node);&lt;BR /&gt;DisplayFeature(null, null, layerId, FloodMapServerURL);&lt;/P&gt;&lt;P&gt;if ($("#chkChangeExtent").prop("checked")) {&lt;BR /&gt;SetMapExtent(node.parent.extent);&lt;BR /&gt;}&lt;BR /&gt;$(this).closest("table").find("tr.tblInfoWindowTrSelected").removeClass("tblInfoWindowTrSelected");&lt;BR /&gt;$(this).closest("tr").addClass("tblInfoWindowTrSelected");&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;QueryTask exixsts in the new version but IdentifyTask has been removed and the replacement is&amp;nbsp;&lt;SPAN&gt;"esri/rest/identify".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I used identify based on the sample&amp;nbsp;&lt;A href="https://codepen.io/pen?editors=1010" target="_blank" rel="noopener"&gt;https://codepen.io/pen?editors=1010&lt;/A&gt;&amp;nbsp;and rewrote the code got "promise" error. How can I write the code in Arcgis version 4.x? What is the replacements?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2023 01:52:34 GMT</pubDate>
    <dc:creator>samitalebi</dc:creator>
    <dc:date>2023-07-14T01:52:34Z</dc:date>
    <item>
      <title>QueryTask and IdentifyTask replacement in Arcgis version 4.27</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-identifytask-replacement-in-arcgis/m-p/1308117#M81686</link>
      <description>&lt;P&gt;I'm about to update Arcgis from version 3 to 4.27 but don't have any idea how can I convert the below function:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;function InfWindow(point, screenPoint) {&lt;BR /&gt;var qtLGA = new esri.tasks.QueryTask(WaterConnectMapServerURL + "/16/");&lt;BR /&gt;var qLGA = new esri.tasks.Query();&lt;/P&gt;&lt;P&gt;qtLGA.requestTimeout = 180;&lt;BR /&gt;qLGA.requestTimeout = 180;&lt;/P&gt;&lt;P&gt;qLGA.returnGeometry = false;&lt;BR /&gt;qLGA.outFields = ["ABBNAME"];&lt;BR /&gt;qLGA.geometry = point;&lt;BR /&gt;var qLGADefer = qtLGA.execute(qLGA);&lt;/P&gt;&lt;P&gt;var identifyTask = new esri.tasks.IdentifyTask(FloodMapServerURL);&lt;BR /&gt;identifyTask.requestTimeout = 180;&lt;BR /&gt;var identifyParams = new esri.tasks.IdentifyParameters();&lt;BR /&gt;identifyParams.tolerance = 0;&lt;BR /&gt;identifyParams.returnGeometry = false;&lt;BR /&gt;identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;&lt;BR /&gt;identifyParams.width = map.width;&lt;BR /&gt;identifyParams.height = map.height;&lt;BR /&gt;identifyParams.geometry = point;&lt;BR /&gt;identifyParams.mapExtent = map.extent;&lt;BR /&gt;var identifyDefer = identifyTask.execute(identifyParams);&lt;/P&gt;&lt;P&gt;map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));&lt;BR /&gt;map.infoWindow.setTitle("Loading...");&lt;BR /&gt;map.infoWindow.setContent("");&lt;/P&gt;&lt;P&gt;var promises = new all([qLGADefer, identifyDefer]);&lt;BR /&gt;promises.always(function (results) {&lt;BR /&gt;var infContent = [];&lt;BR /&gt;infContent.push("&amp;lt;table class='tblInfoWindow'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;tr class='tblInfoWindowTrHeader'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th&amp;gt;Study&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th class='th-Internal-Pad'&amp;gt;Layer&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;th class='th-Internal-Pad'&amp;gt;Depth&amp;amp;nbsp;Range&amp;amp;nbsp;(m)&amp;lt;/th&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;/tr&amp;gt;");&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; results.length; i++) {&lt;BR /&gt;if (results[i].features != null) {&lt;BR /&gt;if (jQuery.isEmptyObject(results[i].features)) {&lt;BR /&gt;map.infoWindow.setTitle("Outside Local Council Area");&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;map.infoWindow.setTitle(results[i].features[0].attributes.ABBNAME);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if ($.isArray(results[i])) {&lt;BR /&gt;if (results[i].length == 0) {&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;for (var j = 0; j &amp;lt; results[i].length; j++) {&lt;BR /&gt;infContent.push("&amp;lt;tr class='tblInfoWindowTrData'&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;td&amp;gt;" + IDtoLabel[results[i][j].layerId] + "&amp;lt;/td&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;&amp;lt;a title='Turn on layer' href='javascript&amp;amp;colon;void(0)' class='LayerLink " + results[i][j].layerId + "'&amp;gt;" + results[i][j].layerName + "&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;");&lt;BR /&gt;if (results[i][j].displayFieldName.toUpperCase().indexOf("RANGE") != -1)&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;" + results[i][j].value + "&amp;lt;/td&amp;gt;");&lt;BR /&gt;else&lt;BR /&gt;infContent.push("&amp;lt;td class='td-Internal-Pad'&amp;gt;Extent only&amp;lt;/td&amp;gt;");&lt;BR /&gt;infContent.push("&amp;lt;/tr&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;infContent.push("&amp;lt;/table&amp;gt;");&lt;BR /&gt;map.infoWindow.resize(400, 200);&lt;BR /&gt;var infContentJoined = infContent.join('');&lt;BR /&gt;if (infContentJoined.indexOf("tblInfoWindowTrData") == -1) {&lt;BR /&gt;map.infoWindow.setContent("No study data available at this location. Searching nearby...");&lt;BR /&gt;SearchWithTolerance(point);&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;map.infoWindow.setContent(infContentJoined);&lt;BR /&gt;$(".tblInfoWindow").find("img.pdfIcon_layer").click(function () {&lt;BR /&gt;var layerID = $(this).attr("id").replace("img_layer", "");&lt;BR /&gt;OpenPDFLink(layerID);&lt;BR /&gt;});&lt;BR /&gt;$(".tblInfoWindow").find("img.Question").click(function () {&lt;BR /&gt;var layerID = $(this).attr("id").replace("question_layer", "");&lt;BR /&gt;var layerName = $.trim($(this).parent().text());&lt;BR /&gt;OpenQuestionLink(layerID, layerName);&lt;BR /&gt;});&lt;BR /&gt;$(".LayerLink").click(function () {&lt;BR /&gt;var $tree2 = $("#tree2");&lt;BR /&gt;var layerId = parseInt($(this).attr("class").replace("LayerLink ", ""), 10);&lt;BR /&gt;var node = $tree2.tree('getNodeById', layerId);&lt;BR /&gt;if (node) {&lt;BR /&gt;$tree2.tree('openNode', node.parent, false);&lt;BR /&gt;$tree2.tree('selectNode', node);&lt;BR /&gt;DisplayFeature(null, null, layerId, FloodMapServerURL);&lt;/P&gt;&lt;P&gt;if ($("#chkChangeExtent").prop("checked")) {&lt;BR /&gt;SetMapExtent(node.parent.extent);&lt;BR /&gt;}&lt;BR /&gt;$(this).closest("table").find("tr.tblInfoWindowTrSelected").removeClass("tblInfoWindowTrSelected");&lt;BR /&gt;$(this).closest("tr").addClass("tblInfoWindowTrSelected");&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;QueryTask exixsts in the new version but IdentifyTask has been removed and the replacement is&amp;nbsp;&lt;SPAN&gt;"esri/rest/identify".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I used identify based on the sample&amp;nbsp;&lt;A href="https://codepen.io/pen?editors=1010" target="_blank" rel="noopener"&gt;https://codepen.io/pen?editors=1010&lt;/A&gt;&amp;nbsp;and rewrote the code got "promise" error. How can I write the code in Arcgis version 4.x? What is the replacements?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 01:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-identifytask-replacement-in-arcgis/m-p/1308117#M81686</guid>
      <dc:creator>samitalebi</dc:creator>
      <dc:date>2023-07-14T01:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask and IdentifyTask replacement in Arcgis version 4.27</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-identifytask-replacement-in-arcgis/m-p/1308227#M81695</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The link to your codepen is points to an empty codepen. In any case you can use the identify similar to what is shown below.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const params = {
  geometry: event.mapPoint,
  tolerance: 3,
  mapExtent: view.extent
};

identify.identify("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer", params).then((results)=&amp;gt;{
   console.log(results);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-identifytask-replacement-in-arcgis/m-p/1308227#M81695</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-07-14T15:06:10Z</dc:date>
    </item>
  </channel>
</rss>

