-
change
Collection change事件
在集合中添加、重新排序或刪除項目後觸發。使用影響 Collection 類型屬性的其他類的方法也會導致觸發此事件,例如 Map.add() 、 Map.remove() 、 Map.reorder() 。
例如,
map.layers.add(newLyr)
和map.add(newLyr)
使用 Map.add() 將新層添加到map.layers
集合將導致此事件觸發。更改事件可用於通知開發人員/用戶對集合的更改。
-
類型 說明 added Array使用 add() 或 addMany() 添加到集合中的項目數組。
moved Array使用 reorder() 在集合中移動的項目數組。
removed Array使用 remove()、removeMany()、removeAt() 或 removeAll() 從集合中刪除的項目數組。
屬性:
例子:
// This function will fire each time a layer is either added, // moved, or removed from the map.layers Collection map.layers.on("change", function(event){ let newLayers = event.added; // An array of layers added to the map.layers Collection let reorderedLayers = event.moved; // An array of layers moved in the Collection let removedLayers = event.removed; // An array of layers removed from map });
-
基本信息
以下是所在類或對象的基本信息。
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 change事件
的定義如下:
相關用法
- JavaScript ArcGIS SceneModifications before-remove事件用法及代碼示例
- JavaScript ArcGIS SceneModifications after-changes事件用法及代碼示例
- JavaScript ArcGIS SceneModifications before-changes事件用法及代碼示例
- JavaScript ArcGIS SceneModifications after-remove事件用法及代碼示例
- JavaScript ArcGIS SceneModifications after-add事件用法及代碼示例
- JavaScript ArcGIS SceneModifications before-add事件用法及代碼示例
- JavaScript ArcGIS SceneModifications.filter用法及代碼示例
- JavaScript ArcGIS SceneModifications.getItemAt用法及代碼示例
- JavaScript ArcGIS SceneModifications.join用法及代碼示例
- JavaScript ArcGIS SceneModifications.shift用法及代碼示例
- JavaScript ArcGIS SceneModifications.flatten用法及代碼示例
- JavaScript ArcGIS SceneModifications.push用法及代碼示例
- JavaScript ArcGIS SceneModifications.removeAll用法及代碼示例
- JavaScript ArcGIS SceneModifications.removeMany用法及代碼示例
- JavaScript ArcGIS SceneModifications.unshift用法及代碼示例
- JavaScript ArcGIS SceneModifications.lastIndexOf用法及代碼示例
- JavaScript ArcGIS SceneModifications.slice用法及代碼示例
- JavaScript ArcGIS SceneModifications.find用法及代碼示例
- JavaScript ArcGIS SceneModifications.includes用法及代碼示例
- JavaScript ArcGIS SceneModifications.some用法及代碼示例
- JavaScript ArcGIS SceneModifications.concat用法及代碼示例
- JavaScript ArcGIS SceneModifications.indexOf用法及代碼示例
- JavaScript ArcGIS SceneModifications.splice用法及代碼示例
- JavaScript ArcGIS SceneModifications.forEach用法及代碼示例
- JavaScript ArcGIS SceneModifications.removeAt用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 SceneModifications change event。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。