laptop and a wrench

Bogue

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

Dernière publication: April 25, 2019 ArcGIS API for JavaScript
Numéro d’ID de bogue BUG-000094781
EnvoiMarch 9, 2016
Dernière modificationJune 5, 2024
S’applique àArcGIS API for JavaScript
Version trouvée3.15
Système d’exploitationWindows OS
Version du système d’exploitation7.0 64 Bit
StatutNon-Reproducible

Informations supplémentaires

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(); }); }

Étapes pour reproduire

ID de bogue: BUG-000094781

Logiciel:

  • ArcGIS API for JavaScript

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement