<?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 Promises replacement in arcgis version 4.27 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/promises-replacement-in-arcgis-version-4-27/m-p/1309875#M81741</link>
    <description>&lt;P&gt;I'm updating Arcgis SDK from 3 to 4.27 but don't have any idea how I can implement promises on the below code:&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.layerIds = [0, 2];&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;&lt;STRONG&gt;var promises = new all([qLGADefer, identifyDefer]);&lt;/STRONG&gt;&lt;BR /&gt;promises.always(function (results) {&lt;/P&gt;&lt;P&gt;//calling another IdentityTask and having promises on the below code&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 = parseInt(tolerance, 10);&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;&lt;STRONG&gt;var promises = new all([identifyDefer]);&lt;/STRONG&gt;&lt;BR /&gt;promises.always(function (results) {&lt;/P&gt;&lt;P&gt;//doing something&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;});&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used Identity instead of IdentifyTask in a new version but my main issue is how can I implement the promise or async/await model on the above code.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 00:59:57 GMT</pubDate>
    <dc:creator>samitalebi</dc:creator>
    <dc:date>2023-07-20T00:59:57Z</dc:date>
    <item>
      <title>Promises replacement in arcgis version 4.27</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/promises-replacement-in-arcgis-version-4-27/m-p/1309875#M81741</link>
      <description>&lt;P&gt;I'm updating Arcgis SDK from 3 to 4.27 but don't have any idea how I can implement promises on the below code:&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.layerIds = [0, 2];&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;&lt;STRONG&gt;var promises = new all([qLGADefer, identifyDefer]);&lt;/STRONG&gt;&lt;BR /&gt;promises.always(function (results) {&lt;/P&gt;&lt;P&gt;//calling another IdentityTask and having promises on the below code&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 = parseInt(tolerance, 10);&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;&lt;STRONG&gt;var promises = new all([identifyDefer]);&lt;/STRONG&gt;&lt;BR /&gt;promises.always(function (results) {&lt;/P&gt;&lt;P&gt;//doing something&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;});&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used Identity instead of IdentifyTask in a new version but my main issue is how can I implement the promise or async/await model on the above code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 00:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/promises-replacement-in-arcgis-version-4-27/m-p/1309875#M81741</guid>
      <dc:creator>samitalebi</dc:creator>
      <dc:date>2023-07-20T00:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Promises replacement in arcgis version 4.27</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/promises-replacement-in-arcgis-version-4-27/m-p/1310129#M81744</link>
      <description>&lt;P&gt;The 4.x API uses native &lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" target="_self"&gt;Promises&lt;/A&gt; instead of dojo's &lt;A href="https://dojotoolkit.org/reference-guide/1.10/dojo/Deferred.html" target="_self"&gt;Deferred&lt;/A&gt; objects.&amp;nbsp; To delay execution until multiple promises have resolved, you can use either &lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all" target="_self"&gt;Promise.all&lt;/A&gt; or &lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled" target="_self"&gt;Promise.allSettled&lt;/A&gt;, depending on which you find more suitable.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 17:02:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/promises-replacement-in-arcgis-version-4-27/m-p/1310129#M81744</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-07-20T17:02:04Z</dc:date>
    </item>
  </channel>
</rss>

