AttachmentsViewModel

AMD: require(["geoscene/widgets/Attachments/AttachmentsViewModel"], (AttachmentsViewModel) => { /* code goes here */ });
ESM: import AttachmentsViewModel from "@geoscene/core/widgets/Attachments/AttachmentsViewModel.js";
类: geoscene/widgets/Attachments/AttachmentsViewModel
继承于:AttachmentsViewModel Accessor
起始版本:GeoScene Maps SDK for JavaScript 4.15

提供 Attachments 微件的逻辑。

另请参阅

构造函数

new AttachmentsViewModel(properties)
参数
properties Object
optional

有关可能传递给构造函数的所有属性的列表,请参见属性

属性概述

所有属性都可以设置、获取和监听。请参阅使用属性主题。
显示继承属性 隐藏继承属性
名称 类型 描述
AttachmentInfo

当前正在编辑的 AttachmentInfo

更多详情
AttachmentsViewModel
AttachmentInfo[]

在要素上定义的 AttachmentInfo 的集合。

更多详情
AttachmentsViewModel
AttachmentsCapabilities

配置用户可以执行的附件编辑功能。

更多详情
AttachmentsViewModel
String

类的名称。

更多详情
Accessor
Graphic

附件的图形。

更多详情
AttachmentsViewModel
String

用户执行的当前模式。

更多详情
AttachmentsViewModel
String

微件的当前状态。

更多详情
AttachmentsViewModel
Boolean

定义要素是否支持调整附件大小。

更多详情
AttachmentsViewModel

属性详细信息

activeAttachmentInfo AttachmentInfo

当前正在编辑的 AttachmentInfo

另请参阅
attachmentInfos AttachmentInfo[]readonly

在要素上定义的 AttachmentInfo 的集合。

另请参阅
起始版本:GeoScene Maps SDK for JavaScript 4.27

配置用户可以执行的附件编辑功能。

declaredClass Stringreadonly inherited

类的名称。声明的类名称格式化为 geoscene.folder.className

graphic Graphic

附件的图形。

mode String

用户执行的当前模式。

可能值"view"|"add"|"edit"

默认值:"view"
state Stringreadonly

微件的当前状态。

可能值"ready"|"disabled"|"loading"

默认值:"ready"
supportsResizeAttachments Boolean

定义要素是否支持调整附件大小。这取决于要素图层的 capabilities.operations.supportsResizeAttachments 是否设置为 true

方法概述

显示继承的方法 隐藏继承的方法
名称 返回值类值 描述

添加一个或多个与对象生命周期相关联的句柄

更多详情
Accessor
Promise<AttachmentInfo[]>

查询要素上的附件。

更多详情
AttachmentsViewModel
Boolean

如果存在指定的句柄组,则返回 true。

更多详情
Accessor

移除对象拥有的句柄组。

更多详情
Accessor

方法详细说明

addHandles(handleOrHandles, groupKey)inherited
起始版本:GeoScene Maps SDK for JavaScript 4.25

添加一个或多个与对象的生命周期相关联的句柄。当对象被销毁时,将移除句柄。

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
参数
handleOrHandles WatchHandle|WatchHandle[]

对象销毁后,标记为要移除的句柄。

groupKey *
optional

标识句柄应添加到的组的键。组中的所有句柄稍后都可使用 Accessor.removeHandles() 进行删除。如果未提供键,则句柄将被添加到默认组。

getAttachments(){Promise<AttachmentInfo[]>}

查询要素上的附件。如果图层的 capabilities.operations.supportsQueryAttachmentstrue,则可查询多个要素的附件。

返回
类型 描述
Promise<AttachmentInfo[]> 解析后,返回查询要素的 AttachmentInfo
另请参阅
hasHandles(groupKey){Boolean}inherited
起始版本:GeoScene Maps SDK for JavaScript 4.25

如果存在指定的句柄组,则返回 true。

参数
groupKey *
optional

组键。

返回
类型 描述
Boolean 如果存在指定的句柄组,则返回 true
示例
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}
removeHandles(groupKey)inherited
起始版本:GeoScene Maps SDK for JavaScript 4.25

移除对象拥有的句柄组。

参数
groupKey *
optional

要移除的组键或组键的数组或集合。

示例
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

类型定义

AttachmentsCapabilities

指定可用附件功能的对象。

属性
editing Boolean
optional

指示是否允许编辑附件。必须启用要素图层才能支持编辑。默认值为 false

operations Object[]
optional

描述可配置的附件操作。请参阅以下对象规范。

规范
optional

指示是否允许添加附件。默认值为 true

update Boolean
optional

指示是否允许更新现有附件。默认值为 true

delete Boolean
optional

指示是否允许删除现有附件。默认值为 true

您的浏览器不再受支持。请升级您的浏览器以获得最佳体验。