<?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: FeatureLayer events�?� Which one fires when load / drawing complete? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278240#M25651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried using the map's update-end event?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2013 16:30:21 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2013-10-30T16:30:21Z</dc:date>
    <item>
      <title>FeatureLayer events??? Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278239#M25650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm adding a FeatureLayer to a map and setting the definitionExpression for the layer. What I want is to zoom to the features that are loaded. I can't seem to find the event that is fired when the loading / drawing of the layer is complete. I've tried both the load and the update-end events, but it seems both of them are getting fired before the features are actually on the map. Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278239#M25650</guid>
      <dc:creator>DerrickMartin</dc:creator>
      <dc:date>2013-10-30T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer events�?� Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278240#M25651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried using the map's update-end event?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278240#M25651</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-10-30T16:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer events�?� Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278241#M25652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried that, but since I do a map.setExtent based on the extent of the features, it gets stuck in a loop, where the update-end fires, I do the zoom, which then triggers another map update�?� &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe I should re-word my question as�?� How to zoom to the extent of a feature layer after applying a definition expression?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 19:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278241#M25652</guid>
      <dc:creator>DerrickMartin</dc:creator>
      <dc:date>2013-10-30T19:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer events�?� Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278242#M25653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To prevent the recursive loop, use a flag variable, like below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;PRE class="plain" name="code"&gt;var bolDefExpSet = false;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;set bolDefExpSet to true right after featureLayer.setDefinitionExpression.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;PRE class="plain" name="code"&gt;map.on("update-end", function() {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/LI&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (bolDefExpSet) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set map extent to the feature layer feature extent&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(...);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // reset bolDefExpSet to prevent the recursive loop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bolDefExpSet = false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;});&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 02:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278242#M25653</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-10-31T02:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer events�?� Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278243#M25654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you! Using the Ken's idea for update-end and zj's idea to stop the looping this is now working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Too bad I can't give both of you the correct answer &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278243#M25654</guid>
      <dc:creator>DerrickMartin</dc:creator>
      <dc:date>2013-10-31T16:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer events�?� Which one fires when load / drawing complete?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278244#M25655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you only want the function to run once you can use the dojo on.once() method. Using what zj wrote:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;map.on.once("update-end", function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set map extent to the feature layer feature extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(...);&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-events-which-one-fires-when-load/m-p/278244#M25655</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T13:33:12Z</dc:date>
    </item>
  </channel>
</rss>

