<?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: Event firing once FeatureLayer (or MapImageLayer) finishes drawing in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1603313#M18315</link>
    <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's rather awkward to use, but I believe the only way to check this information is to access the LayerView.updating property. If updating is false, it is fully drawn and ready to use. It goes true when the layer first loads or when the data or extents change.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Apr 2025 16:08:45 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2025-04-07T16:08:45Z</dc:date>
    <item>
      <title>Event firing once FeatureLayer (or MapImageLayer) finishes drawing</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1603311#M18313</link>
      <description>&lt;P&gt;Is there an event that fires when a FeatureLayer is&amp;nbsp;&lt;STRONG&gt;completely drawn and visible on the map?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Through my documentation search, I have not found one, but I imagine this is a pretty basic functionality that would exist.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let layer = new FeatureLayer({...})
dsManager.current.createDataSource(dataSourceOptions).then((source) =&amp;gt; {
  map.current.view.map.add(layer) 
  map.current.createJimuLayerView(layer, map.current.id, layer.id, source, true)
})

layer.on('layerview-create', () =&amp;gt; {...})&lt;/LI-CODE&gt;&lt;P&gt;Currently, the closest thing I have found is this, however, this event fires far before the layer has finished drawing and displaying to the user. It would also be helpful to find a similar event for a MapImageLayer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Similar to this, but for the 4.x API / Experience Builder:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fire-event-when-featurelayer-graphic-finishes/m-p/57021#M5000" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fire-event-when-featurelayer-graphic-finishes/m-p/57021#M5000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 15:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1603311#M18313</guid>
      <dc:creator>jwilner_amica</dc:creator>
      <dc:date>2025-04-07T15:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Event firing once FeatureLayer (or MapImageLayer) finishes drawing</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1603313#M18315</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's rather awkward to use, but I believe the only way to check this information is to access the LayerView.updating property. If updating is false, it is fully drawn and ready to use. It goes true when the layer first loads or when the data or extents change.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 16:08:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1603313#M18315</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-04-07T16:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Event firing once FeatureLayer (or MapImageLayer) finishes drawing</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1605700#M18447</link>
      <description>&lt;P&gt;This works exactly as intended. Thank you!&lt;/P&gt;&lt;P&gt;For anyone else who might look at this in the future, here is my implementation.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function addLayer(layer: FeatureLayer | ImageryLayer, label: string, type) {
        const data: DataSourceJson = {
            id: layer.id + '_ds',
            layerId: layer.id,
            label: label,
            type: type,
        }

        const dataJson = Immutable(data)
        const dataSourceOptions = {
            id: layer.id + '_ds',
            layer: layer,
            dataSourceJson: dataJson,
        }

        dsManager.current.createDataSource(dataSourceOptions).then((source) =&amp;gt; {
            map.current.view.map.add(layer)
            map.current.createJimuLayerView(layer, map.current.id, layer.id, source, true).then((layerView) =&amp;gt; {
                const interval = setInterval(() =&amp;gt; {
                    if (layerView.view &amp;amp;&amp;amp; !layerView.view.updating) {
                        clearInterval(interval)
                        map.current.view.goTo(claimsLayerExtent.current);
                        // or any other actions you would like to take!
                    }
                }, 50)
            }).catch((error) =&amp;gt; {
                console.error('Error creating LayerView:', error)
            });
        }).catch((error) =&amp;gt; {
            console.error('Error creating DataSource:', error)
        });
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Apr 2025 16:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/event-firing-once-featurelayer-or-mapimagelayer/m-p/1605700#M18447</guid>
      <dc:creator>jwilner_amica</dc:creator>
      <dc:date>2025-04-14T16:25:39Z</dc:date>
    </item>
  </channel>
</rss>

