laptop and a wrench

漏洞

The renderer being generated via the 'colorRendererCreator.createClassBreaksRenderer()' method shows inconsistent behavior in ArcGIS Maps SDK for JavaScript 4.30.

ArcGIS Maps SDK for JavaScript
漏洞 ID 编号 BUG-000169933
已提交August 13, 2024
上次修改时间December 6, 2024
适用范围ArcGIS Maps SDK for JavaScript
找到的版本4.30
操作系统Windows OS
操作系统版本10.0 64 Bit
状态Known Limit

附加信息

This is by design for performance reasons. Arcade is used as the data input for generating the renderer. Arcade executes client-side and therefore all data referenced in Arcade expressions should be available on the client. On the first pass of generating the renderer, the client does not have the attributes required for executing the expression. So the generate renderer function samples features from the service that includes the required data. The expression then executes client-side and a renderer is generated for the entire renderer. On the second pass, the data is already available on the client. For that reason, there is no need to query a sample of features for generating the renderer. The data is queried client-side using a layer view query and breaks are generated from that result. Unfortunately layer view queries only consider data that is visible in the view. In this case, only four features are available in the view and therefore the function cannot generate five class breaks. It can only generate a max of four breaks. It also only considers those four features in generating those breaks, so the breaks themselves are different than when sampling from the whole dataset. To observe this, zoom out and all other features are excluded from the class breaks. Generally speaking, always author a renderer at the scale the renderer is most likely to be viewed at. For this reproduction case, if the renderer for a layer representing U.S. States is generated, then the interface zoomed to the extent of the U.S. states when creating the renderer.

解决办法

There are a couple of ways to work around this issue. If using a basic expression like the one provided, set field and normalizationField in the function, and the renderer generates consistently every time because server queries are always used against the whole dataset. If Arcade is required, zoom to the widest extent where the data is most likely to be viewed.

In the example provided, it is supposed to be zoomed to the extent of the United States (since it is a state layer). Regenerate the renderer there and breaks consistent with the first generation can be seen. Generally speaking, it is not a good practice to generate styles at very large scales (zoomed in) when it is possible to view more data at smaller scales.

重现步骤

漏洞 ID: BUG-000169933

软件:

  • ArcGIS Maps SDK for JavaScript

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项