-
addMany
(items, index)
將多個項目添加到集合中。將項目添加到集合後會觸發更改事件。
參數:
類型 說明 items Array|Collection要添加的項目的數組或集合。
index Number可選的 集合中要添加項目的位置的從零開始的索引。如果未指定,項目將添加到最後。
例子:
// Creates two new graphics let gpc1 = new Graphic(); let gpc2 = new Graphic(); let layer = new GraphicsLayer(); // Creates a new graphics layer // Adds both graphics to layer's graphics collection layer.graphics.addMany([gpc1, gpc2]);
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/core/Collection"], (Collection) => { /* code goes here */ });
ESM:
import Collection from "@arcgis/core/core/Collection";
類:
esri/core/Collection
繼承: Collection > Accessor
自從:用於 JavaScript 4.0 的 ArcGIS API
用法說明
Collection.addMany
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Collection.add用法及代碼示例
- JavaScript ArcGIS Collection.at用法及代碼示例
- JavaScript ArcGIS Collection.lastIndexOf用法及代碼示例
- JavaScript ArcGIS Collection.ofType用法及代碼示例
- JavaScript ArcGIS Collection.pop用法及代碼示例
- JavaScript ArcGIS Collection.reverse用法及代碼示例
- JavaScript ArcGIS Collection.find用法及代碼示例
- JavaScript ArcGIS Collection.removeMany用法及代碼示例
- JavaScript ArcGIS Collection.toArray用法及代碼示例
- JavaScript ArcGIS Collection.some用法及代碼示例
- JavaScript ArcGIS Collection.remove用法及代碼示例
- JavaScript ArcGIS Collection.concat用法及代碼示例
- JavaScript ArcGIS Collection.unshift用法及代碼示例
- JavaScript ArcGIS Collection.splice用法及代碼示例
- JavaScript ArcGIS Collection.sort用法及代碼示例
- JavaScript ArcGIS Collection.every用法及代碼示例
- JavaScript ArcGIS Collection.push用法及代碼示例
- JavaScript ArcGIS Collection.indexOf用法及代碼示例
- JavaScript ArcGIS Collection.slice用法及代碼示例
- JavaScript ArcGIS Collection.forEach用法及代碼示例
- JavaScript ArcGIS Collection.includes用法及代碼示例
- JavaScript ArcGIS Collection.findIndex用法及代碼示例
- JavaScript ArcGIS Collection.shift用法及代碼示例
- JavaScript ArcGIS Collection.filter用法及代碼示例
- JavaScript ArcGIS Collection.join用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Collection.addMany。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。