laptop and a wrench

漏洞

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

上次发布: April 6, 2020 ArcGIS API for JavaScript
漏洞 ID 编号 BUG-000127418
已提交December 16, 2019
上次修改时间July 20, 2025
适用范围ArcGIS API for JavaScript
找到的版本4.13
操作系统Windows OS
操作系统版本10.0 64 Bit
修正版本4.15
状态Fixed

解决办法

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

         }

       }

     }

    }

重现步骤

漏洞 ID: BUG-000127418

软件:

  • ArcGIS API for JavaScript

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项