| 漏洞 ID 编号 |
BUG-000169933 |
| 已提交 | August 13, 2024 |
| 上次修改时间 | December 6, 2024 |
| 适用范围 | ArcGIS Maps SDK for JavaScript |
| 找到的版本 | 4.30 |
| 操作系统 | Windows OS |
| 操作系统版本 | 10.0 64 Bit |
| 状态 | Known Limit
经开发团队审核,已确定此问题与不受 Esri 控制的软件的已知限制有关。 问题的“其他信息”部分可能包含进一步说明。
|
附加信息
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.
重现步骤