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


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


基本信息

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

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.indexOf函数(或属性)的定义如下:

indexOf (searchElement, fromIndex) {Number} inherited


返回集合中元素的索引。

参数:

类型说明
searchElement *

要在集合中搜索的项目。

fromIndex Number
可选的

如果您不想搜索整个集合或不想从头开始搜索,请使用。

返回:

类型 说明
Number 在集合中找到的第一个匹配项的位置,如果没有匹配项,则为 -1。

例子:

// index is the index of the first graphic in the
// graphics layer that matches the input graphic
let index = graphicsLayer.graphics.indexOf(graphic);

相关用法


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