我正在尝试使用 ESRI ArcGIS for JavaScript 4.10 中的uniqueValues函数。
但是,此消息失败:
消息:“从 layerView 查询统计信息需要查看”名称:“feature-layer-adapter:insufficient-data”
我有一个FeatureLayer
with features 和一个名为sStatus
. 我也有一个基于此字段的Legend
设置可以正常工作。UniqueValueRenderer
sStatus
这是我的代码:
uniqueValues({
layer: layer,
field: "sStatus"
}).then(function (response) {
// prints each unique value and the count of features containing that value
var infos = response.uniqueValueInfos;
console.log('test');
infos.forEach(function (info) {
console.log("Wells : ", info.value, " # of Wells ", info.count);
});
}).catch(errback);
注意:如果我将字段名称更改为“ status
”,则控制台中的错误消息会更改:
消息:“未知字段:状态。您只能使用层架构中定义的字段”名称:“唯一值:无效参数”
这表明我的领域sStatus
是正确的,但我不明白为什么它不能开箱即用。
任何想法为什么这会失败?