<?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 How can I get Map.setExtent to fire immediately? Deferred problem?? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-map-setextent-to-fire-immediately/m-p/265076#M24504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom SOE which returns a large JSON.&amp;nbsp;Part of the JSON string is the extent that I will ultimately need to zoom to. The main guts of the JSON (the "results" section) takes several seconds to process and is unrelated to the "extentToZoomTo" section. &amp;nbsp;&amp;nbsp;Because I have rather complex symbology and am not using a cached image service, map.setExtent also takes a few seconds to complete. &amp;nbsp;What I would like to do is to call map.setExtent immediately after I get the JSON, and then while the &lt;EM&gt;server&lt;/EM&gt; is busy doing that, the client code can work on the "results". &amp;nbsp;How can I make that happen?? &amp;nbsp;What I have found is that if I simply call map.setExtent before I start processing the "results" section, it doesn't actually&amp;nbsp;send that request to the server until&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;after&lt;/EM&gt;&lt;/SPAN&gt; the results have been completely processed. &amp;nbsp;I can verify that behavior by inspecting the Network tab in the developer tools. I'm guessing that this has something to do with the fact that &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#setextent"&gt;setExtent &lt;/A&gt;is deferred. &amp;nbsp;How can I get it to fire right away? &amp;nbsp;If it matters, I have ArcGIS Server 10.2. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; "extentToZoomTo": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "xmin": 1234,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "ymin": 4567,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "xmax": 2345,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "ymax": 5678&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "results": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //A very large amount of data here that takes several seconds to process&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Jan 2017 02:36:17 GMT</pubDate>
    <dc:creator>RiverTaig1</dc:creator>
    <dc:date>2017-01-15T02:36:17Z</dc:date>
    <item>
      <title>How can I get Map.setExtent to fire immediately? Deferred problem??</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-map-setextent-to-fire-immediately/m-p/265076#M24504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom SOE which returns a large JSON.&amp;nbsp;Part of the JSON string is the extent that I will ultimately need to zoom to. The main guts of the JSON (the "results" section) takes several seconds to process and is unrelated to the "extentToZoomTo" section. &amp;nbsp;&amp;nbsp;Because I have rather complex symbology and am not using a cached image service, map.setExtent also takes a few seconds to complete. &amp;nbsp;What I would like to do is to call map.setExtent immediately after I get the JSON, and then while the &lt;EM&gt;server&lt;/EM&gt; is busy doing that, the client code can work on the "results". &amp;nbsp;How can I make that happen?? &amp;nbsp;What I have found is that if I simply call map.setExtent before I start processing the "results" section, it doesn't actually&amp;nbsp;send that request to the server until&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;after&lt;/EM&gt;&lt;/SPAN&gt; the results have been completely processed. &amp;nbsp;I can verify that behavior by inspecting the Network tab in the developer tools. I'm guessing that this has something to do with the fact that &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#setextent"&gt;setExtent &lt;/A&gt;is deferred. &amp;nbsp;How can I get it to fire right away? &amp;nbsp;If it matters, I have ArcGIS Server 10.2. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; "extentToZoomTo": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "xmin": 1234,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "ymin": 4567,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "xmax": 2345,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "ymax": 5678&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "results": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //A very large amount of data here that takes several seconds to process&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Jan 2017 02:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-map-setextent-to-fire-immediately/m-p/265076#M24504</guid>
      <dc:creator>RiverTaig1</dc:creator>
      <dc:date>2017-01-15T02:36:17Z</dc:date>
    </item>
  </channel>
</rss>

