laptop and a wrench

Error

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

Última publicación: April 6, 2020 ArcGIS API for JavaScript
Número de ID del error BUG-000127418
EnviadoDecember 16, 2019
Última modificaciónJuly 20, 2025
Relacionado conArcGIS API for JavaScript
Versión encontrada4.13
Sistema operativoWindows OS
Versión de sistema operativo10.0 64 Bit
Versión corregida4.15
EstadoFixed

Solución alternativa

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

         }

       }

     }

    }

Pasos para reproducir

ID del error: BUG-000127418

Software:

  • ArcGIS API for JavaScript

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga