laptop and a wrench

Bogue

The layers order within the Legend is not updated if the order of the layers on the map is changed.

Dernière publication: April 6, 2020 ArcGIS API for JavaScript
Numéro d’ID de bogue BUG-000127418
EnvoiDecember 16, 2019
Dernière modificationJuly 20, 2025
S’applique àArcGIS API for JavaScript
Version trouvée4.13
Système d’exploitationWindows OS
Version du système d’exploitation10.0 64 Bit
Version de correction4.15
StatutFixed

Solution de contournement

Add the additional code to reflect the changes within the Legend.

Uncomment line 39-58 in the codepen sample to see the changes:

 

if(true){

     

     LegendViewModel.prototype._addActiveLayerInfo = function(e, t) {

       if (this._isLayerActive(t) && -1 === this.activeLayerInfos.indexOf(e)) {

         var r = e.parent;

          

         if(r){ 

          if(-1 === r.children.indexOf(e)){

           r.children.push(e)

          };

          this._sortActiveLayerInfos(r.children)

         }else{ 

          this.activeLayerInfos.add(e);

          this._sortActiveLayerInfos(this.activeLayerInfos);

         }

       }

     }

    }

Étapes pour reproduire

ID de bogue: BUG-000127418

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