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


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。