laptop and a wrench

漏洞

In ArcGIS Maps SDK for JavaScript 4.28, the properties of a WMSSubLayer like minScale and maxScale can only be read correctly if the SubLayer is added subsequently.

ArcGIS Maps SDK for JavaScript
漏洞 ID 编号 BUG-000163573
已提交December 8, 2023
上次修改时间December 6, 2024
适用范围ArcGIS Maps SDK for JavaScript
找到的版本4.28
操作系统Windows OS
操作系统版本11.0 64 bit
状态Known Limit

附加信息

When assigning a value to WMSLayer.sublayers at layer initialization, it essentially overwrites the layer's sublayers discovered from the service's get capabilities response. Unless specified, all sublayer properties are set to their default values, instead of the values found in the service. The solution is to wait for the layer to load and then 'turn off' the undesired sublayers. This ensures that all sublayer properties, like minScale and maxScale, are imported from the layer's get capabilities response. For example: const wmsLayer = new WMSLayer({   url: "your-url-here" }); await wmsLayer.load(); const sublayer = wmsLayer.findSublayerByName("my-sublayer-name"); if (sublayer) { // check if sublayer exists   wmsLayer.sublayers = [sublayer]; // only show desired sublayer } map.add(wmsLayer); The team plans to update the documentation to make this more clear.

解决办法

Add the WMSSubLayer subsequently.

For example: const wmsLayer = new WMSLayer({ url: "your-url-here" }); await wmsLayer.load(); const sublayer = wmsLayer.findSublayerByName("my-sublayer-name"); if (sublayer) { // check if sublayer exists wmsLayer.sublayers = [sublayer]; }

重现步骤

漏洞 ID: BUG-000163573

软件:

  • ArcGIS Maps SDK for JavaScript

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项