当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS GeoJSONLayerView.availableFields用法及代码示例


基本信息

以下是所在类或对象的基本信息。

类: esri/views/layers/GeoJSONLayerView

继承: GeoJSONLayerView > LayerView > Accessor

自从:用于 JavaScript 4.11 的 ArcGIS API

用法说明

GeoJSONLayerView.availableFields函数(或属性)的定义如下:

availableFields String[] readonly


自从:ArcGIS 适用于 JavaScript 4.15 的 API

为每个要素获取的属性字段列表,包括图层 renderinglabelingelevation info 所需的字段以及 GeoJSONLayer.outFields 上定义的其他字段。当 LayerView 完成更新时,availableFields 属性将被填充。 availableFields 在客户端过滤或查询要素时使用。

例子:

view.whenLayerView(layer).then(function(layerView){
  layerView.watch("updating", function(value){
    // availableFields will become available
    // once the layerView finishes updating
    if (!value) {
       layerView.queryFeatures({
         outFields: layerView.availableFields,
         where: "magnitude > 6"
       })
       .then(function(results) {
         console.log(results.features.length, " features returned");
       })
       .catch(function(error) {
         console.log("query failed: ", error);
       });
     }
  });
});

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 GeoJSONLayerView.availableFields。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。