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


JavaScript ArcGIS View.destroy用法及代碼示例

基本信息

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

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

ESM: import View from "@arcgis/core/views/View";

類: esri/views/View

繼承: View > Accessor

子類: MapView , SceneView

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

View.destroy函數(或屬性)的定義如下:

destroy ()


自從:ArcGIS 適用於 JavaScript 4.17 的 API

銷毀視圖以及任何關聯的資源,包括其Map、彈出窗口和 UI 元素。一旦視圖被破壞,這些就不能再使用。為了防止這些組件被破壞,請在調用 destroy() 之前將它們從視圖中刪除。

// remove popup and legend from the view so that they are not destroyed
const popup = view.popup;
view.popup = null;
view.ui.remove(legend);

// unset map from the view so that it is not destroyed
const map = view.map;
view.map = null;

// destroy the view and any remaining associated resources
view.destroy();

相關用法


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