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


JavaScript ArcGIS SceneModifications.some用法及代码示例


基本信息

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

AMD: require(["esri/layers/support/SceneModifications"], (SceneModifications) => { /* code goes here */ });

ESM: import SceneModifications from "@arcgis/core/layers/support/SceneModifications";

类: esri/layers/support/SceneModifications

继承: SceneModifications > Collection > Accessor

自从:用于 JavaScript 4.16 的 ArcGIS API

用法说明

SceneModifications.some函数(或属性)的定义如下:

some (callback) {Boolean} inherited


确定集合中的项目是否通过 callback 定义的测试。集合中的每个项目都被传递到回调中,直到返回一个值 true

参数:

类型说明
callback ItemCallback

为每个 Collection 项定义测试的函数。

返回:

类型 说明
Boolean 如果集合中的任何项目通过了在 callback 中定义的测试,则返回 true。如果所有项目都未通过测试,则返回 false

例子:

// If at least one of the point graphics has a geometry whose
// elevation is above 1000m, then passes will have a value of true.
// Otherwise, it will be false.
let passes = graphicsLayer.graphics.some(function(item, i){
  return item.geometry.z > 1000;
});

相关用法


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