<?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 - &amp;quot;load&amp;quot;-event do not fire in some cases in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446712#M41256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yes, I do add it to the map. The layer is rendering too, including a DynamicMap and a few more FeatureLayers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just tested adding the layers in the map.on("load") event, but then the event is never fired anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the docs for map.onLoad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Fires when the first or base layer has been successfully added to the map.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, that means I have to add the layers first in order to have that event fired, which my test here confirmed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Mar 2014 13:04:49 GMT</pubDate>
    <dc:creator>ØyvindIdland</dc:creator>
    <dc:date>2014-03-24T13:04:49Z</dc:date>
    <item>
      <title>FeatureLayer - &amp;amp;quot;load&amp;amp;quot;-event do not fire in some cases</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446710#M41254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a case where the "load" event is not being fired for a feature layer (v 3.7). This happens when the app is opened a new window or tab. When doing a full refresh, it triggers again. I do not get any errors-events on this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Update: this happens in some instances of IE10, but it has happened in IE11 aswell.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the docs on the "load"-event states the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Fires after layer properties for the layer are successfully populated. This event must be successful before the layer can be added to the map. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;What does this mean, do I have to add the layer to the map inside the event handler for "load" ? If so, this is not what's being done in the examples (e.g. &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/renderer_temporal.html" rel="nofollow noopener noreferrer" target="_blank"&gt;this&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a stripped version of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
App.mainLayer = new FeatureLayer(mapConfig.featureServiceUrl + "/0", {
 id: mapConfig.featureLayerID,
 mode: FeatureLayer.MODE_ONDEMAND,
 outFields: ["*"],
 visible: true,

});
App.mainLayer.on("error", function (err) {
 console.error("Error loading layer: ", e.stack);
});

App.mainLayer.setDefinitionExpression(layerFilterExpression);

App.mainLayer.on("mouse-over", function () {
 App.map.setMapCursor("pointer");
});
App.mainLayer.on("mouse-out", function () {
 App.map.setMapCursor("default");
});
App.mainLayer.on("load", explLayerLoadedHandler);

function explLayerLoadedHandler(evt) {
 // sometimes not firing
 console.log("Layer loaded.");
 ...
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446710#M41254</guid>
      <dc:creator>ØyvindIdland</dc:creator>
      <dc:date>2021-12-11T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer - "load"-event do not fire in some cases</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446711#M41255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Map onload, you need to add this featurelayer to map. have you added this feature layer to map? the load event of featurelayer will be triggered once the layer is added to map.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 10:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446711#M41255</guid>
      <dc:creator>DeepikaJain</dc:creator>
      <dc:date>2014-03-24T10:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer - "load"-event do not fire in some cases</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446712#M41256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yes, I do add it to the map. The layer is rendering too, including a DynamicMap and a few more FeatureLayers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just tested adding the layers in the map.on("load") event, but then the event is never fired anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the docs for map.onLoad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Fires when the first or base layer has been successfully added to the map.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, that means I have to add the layers first in order to have that event fired, which my test here confirmed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 13:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446712#M41256</guid>
      <dc:creator>ØyvindIdland</dc:creator>
      <dc:date>2014-03-24T13:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer - "load"-event do not fire in some cases</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446713#M41257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried using the event map.on('layer-add-result') or map.on('layers-add-result') when you add the layer to your map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 13:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-amp-amp-quot-load-amp-amp-quot-event/m-p/446713#M41257</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-03-24T13:25:52Z</dc:date>
    </item>
  </channel>
</rss>

