laptop and a wrench

Bug

Unable to capture the load event of a MapImagelayer using ArcGIS API for JavaScript.

Last Published: April 25, 2019 ArcGIS API for JavaScript
Bug ID Number BUG-000094781
SubmittedMarch 9, 2016
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found3.15
Operating SystemWindows OS
Operating System Version7.0 64 Bit
StatusNon-Reproducible

Additional Information

The event is working as expected as there is nothing for the MapImageLayer to load so it automatically is set to true. Here is a general pattern to handle layer loading to execute some code after it loads. var layer = new XyzLayer(...); function doSomethingWithTheLayer() { console.log("Layer loaded"); // Do something } function handleLayerLoadFailure() { console.log("Layer failed to load"); // Do something } if (layer.loaded) { doSomethingWithTheLayer(); } else if (layer.loadError) { handleLayerLoadFailure(); } else { var loadHandle = layer.on("load", function() { loadHandle.remove(); doSomethingWithTheLayer(); }); var loadErrorHandle = layer.on("error", function() { loadErrorHandle.remove(); handleLayerLoadFailure(); }); }

Steps to Reproduce

Bug ID: BUG-000094781

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options