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


JavaScript ArcGIS Collection.push用法及代码示例


基本信息

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

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

ESM: import Collection from "@arcgis/core/core/Collection";

类: esri/core/Collection

继承: Collection > Accessor

子类: SceneModifications

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

Collection.push函数(或属性)的定义如下:

push (item) {Number}


将项目添加到集合的末尾。

参数:

类型说明
item *

要添加到集合末尾的项目或以逗号分隔的项目列表。

返回:

类型 说明
Number 集合的新长度。

例子:

// Adds a new graphic to the end of the graphics collection on a GraphicsLayer
graphicsLyr.graphics.push(newGraphic);
// Adds three new graphics to the end of the GraphicsLayer's graphics collection
graphicsLyr.graphics.push(g1, g2, g3);

相关用法


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