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


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


基本信息

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

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

reorder (item, index) {*} inherited


将集合中的项目移动到指定索引。在集合中移动项目后会触发更改事件。

参数:

类型说明
item *

要移动的项目。

index Number

要将项目移动到的索引。

返回:

类型 说明
* 被移动的项目。 undefined 如果 item 不在集合中

例子:

// Get the first two layers in a map
let layer1 = map.layers.getItemAt(0);
let layer2 = map.layers.getItemAt(1);

// Moves the second layer to the first position in the map.layers Collection
// effectively swapping the positions of layer1 and layer2
map.layers.reorder(layer2, 0);

相关用法


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