<?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: What event can I tap into to wait for the view to finish drawing after basemap toggle? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142096#M13233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jack,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Just watch the views updating property&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Nov 2019 21:39:31 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2019-11-19T21:39:31Z</dc:date>
    <item>
      <title>What event can I tap into to wait for the view to finish drawing after basemap toggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142095#M13232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to wait for the view's basemap to update and finish drawing after a basemap toggle event.&amp;nbsp; Is there a good consistent way to wait for the complete rendering of the map before trying the screenshot?&amp;nbsp; I was thinking of watching the "updating" property on the basemap layerviews, but this seems cumbersome.&amp;nbsp; Also, if I have many feature layers, would I have to watch the "updating" property on all layers before safely using the take screenshot function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a&amp;nbsp;&lt;A href="https://jsbin.com/putivikuje/edit?html,output"&gt;JSBIN&lt;/A&gt;&amp;nbsp;showing a quick example of what I am talking about.&amp;nbsp; Click the basemap toggle to see what I am referring to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 21:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142095#M13232</guid>
      <dc:creator>JackFairfield</dc:creator>
      <dc:date>2019-11-19T21:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: What event can I tap into to wait for the view to finish drawing after basemap toggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142096#M13233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jack,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Just watch the views updating property&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 21:39:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142096#M13233</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-11-19T21:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: What event can I tap into to wait for the view to finish drawing after basemap toggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142097#M13234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried this and it seems to only work sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample updated&amp;nbsp;&lt;A href="https://jsbin.com/povepinivu/edit?html,output"&gt;JSBIN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, after toggling a few times, the screenshot is sometimes black.&amp;nbsp; Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 22:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142097#M13234</guid>
      <dc:creator>JackFairfield</dc:creator>
      <dc:date>2019-11-19T22:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: What event can I tap into to wait for the view to finish drawing after basemap toggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142098#M13235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I downloaded and ran the app locally, and it seemed to work consistently. Perhaps there's some network or synchronicity issue at play.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 23:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142098#M13235</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-11-19T23:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: What event can I tap into to wait for the view to finish drawing after basemap toggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142099#M13236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to reproduce the issue you described. It appears that `view.updating` value changes several time during basemap swapping. So the `view.takeScreenshot()` is called several times and the images sometimes get returned out of order. I created an issue for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In meantime, please add a setTimeout before you call takeScreenshot and this will ensure you get the right image.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;watch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"updating"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;val&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;val&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;setTimeout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;takeScreenshot&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;screenshot&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        screenshotDiv&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;src &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; screenshot&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataUrl&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;500&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:49:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-event-can-i-tap-into-to-wait-for-the-view-to/m-p/142099#M13236</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-12-11T07:49:25Z</dc:date>
    </item>
  </channel>
</rss>

