GeotriggerNotificationOptions

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

当满足 Geotrigger 条件时,控制发送给客户端应用程序客户端的通知信息的选项。

示例
let notificationOptions = new GeotriggerNotificationOptions({
  expressionInfo: { // autocasts as new ExpressionInfo()
    title: "Notice",
    expression: "'You have entered' + $fencefeature.AREA_NAME"
  }),
  requestedActions: [ "showMessage" ]
})

构造函数

new GeotriggerNotificationOptions(properties)
参数
properties Object
optional

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

属性概述

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

类的名称。

更多详情
Accessor
ExpressionInfo

可选的 Arcade 表达式,可用于在满足 Geotrigger 条件时配置通知信息。

更多详情
GeotriggerNotificationOptions
String[]

可选的字符串列表,指示此 Geotrigger 产生的一组可能操作。

更多详情
GeotriggerNotificationOptions

属性详细信息

declaredClass Stringreadonly inherited

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

expressionInfo ExpressionInfo

可选的 Arcade 表达式,可用于在满足 Geotrigger 条件时配置通知信息。该表达式使用 Geotrigger Notification Arcade 配置文件。表达式可以返回将用于面向用户的消息的字符串,也可以返回字典,该字典可以包含带有键 'message’ 的面向用户消息,以及使用键 'actions’ 的应用程序操作的推荐列表。

默认值:null
requestedActions String[]

可选的字符串列表,指示此 Geotrigger 产生的一组可能操作。此属性可显示作者打算为此 Geotrigger 采取的完整建议操作列表。请注意,在发出通知时不需要采取任何行动,但这些措施提供了一种了解 Geotrigger 作者意图的方法。这些字符串可以显示给用户,让他们知道 Geotrigger 的预期行为,也可被客户端应用程序用来确定是否支持所需的操作。如果客户端应用程序收到包含无法识别的操作的通知信息,则应忽略它。操作可以是组织中启用地理触发器的应用程序所支持的任何字符串,并且应包含从 expressionInfo.expression 求值返回的所有可能的“action”值。

默认值:null
示例
// Some actions a client app can consume and define behavior for
options.requestedActions = [ "someAction", "someOtherAction", "aThirdAction" ]

// A more realistic example: actions a client app can consume and define (likely tracking-related) behavior for
options.requestedActions = [ "startTracking", "stopTracking" ]

方法概述

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

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

更多详情
Accessor
this

创建此对象的深度克隆。

更多详情
GeotriggerNotificationOptions
*

创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。

更多详情
GeotriggerNotificationOptions
Boolean

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

更多详情
Accessor

移除对象拥有的句柄组。

更多详情
Accessor
Object

将此类的实例转换为其 GeoScene Portal JSON 表示。

更多详情
GeotriggerNotificationOptions

方法详细说明

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() 进行删除。如果未提供键,则句柄将被添加到默认组。

clone(){this}

创建此对象的深度克隆。任何通过引用存储值的属性都将被分配克隆实例上引用值的副本。

返回
类型 描述
this 调用此方法的类实例的深度克隆。
fromJSON(json){*}static

创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。传入到输入 json 参数的对象通常来自对 REST API 中查询操作的响应或来自另一个 GeoScene 产品的 toJSON() 方法。

参数
json Object

GeoScene 格式实例的 JSON 表示。

返回
类型 描述
* 返回该类的新实例。
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");
toJSON(){Object}

将此类的实例转换为其 GeoScene Portal JSON 表示。有关详细信息,请参阅使用 fromJSON() 指南主题。

返回
类型 描述
Object 此类实例的 GeoScene Portal JSON 表示。

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