當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS DefaultUI.remove用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

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

ESM: import DefaultUI from "@arcgis/core/views/ui/DefaultUI";

類: esri/views/ui/DefaultUI

繼承: DefaultUI > UI > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

DefaultUI.remove函數(或屬性)的定義如下:

remove (component) inherited


從 UI 中刪除一個或多個 HTML 組件或widgets

參數:

類型說明

要從 UI 中移除的組件。這可以是小部件實例、HTML 元素、表示 DOM 節點 ID 的字符串值或包含任何這些類型組合的數組。有關代碼示例,請參閱下麵的示例片段。

例子:

// Removes the BasemapToggle widget from the view if added.
// See the example for add() for more context
view.ui.remove(toggle);
// Removes the default zoom widget from the view's container
view.ui.remove("zoom");
// Removes multiple widgets from the view's UI
view.ui.remove([ compass, toggle, "zoom" ]);

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 DefaultUI.remove。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。