跳转至

Embed a map template in a Workshop module(在 Workshop 模块中嵌入地图模板)

Map templates can be embedded in Workshop modules. Their parameter values can be passed directly from Workshop variables.

There are three steps to embed a map template in a Workshop module:

  1. Add a Map widget in Workshop
  2. Choose a resource
  3. Configure the widget

Add a Map widget in Workshop

In a section of your choice in the Workshop module, select the + icon or + Add widget to open the widget menu, and search for the Map widget.

Choose a resource

In the Layers section of the widget editor, select Import map template instead of the default Local configuration. Under the Resource setting, choose Select to see a list of compatible resources and select the map template resource you want to embed.

Configure the widget

For the Map widget, most of the configuration options are the same for local configuration and embedded templates. For general configuration, refer to the Map widget documentation. Some widget settings only apply to the embedded template configuration:

  • Layers
  • Resource: Choose the map template resource to embed. Optionally provide an Override map RID. If provided, an existing map will be displayed instead of the default map that is generated using the template and its parameters. This allows actions such as loading an existing map from an RID saved in an object property.
  • Parameters: Supply values for template parameters using Workshop variables.
  • Refresh key: Whenever this variable's value changes, the widget will perform a complete reload of the map.
  • Base layer picker: Controls the default background map imagery. When the Show base layer picker toggle is enabled, users can edit the base map from the map widget interface.
  • Load data from scenario: Load the given resource using a scenario instead of the base Ontology.
  • Regenerate map after applying scenario: When set, the map will be refreshed after each scenario modification.

  • Interaction

  • Selected objects: Output an object set of the currently selected object(s). This object set can then be used in downstream widgets in the current module.
  • On selected objects change: Configure Workshop events to trigger when the selected objects on the map change. For example, the trigger could open a drawer with a more detailed view of the selected objects.
  • All visible objects on map: Output an object set of the visible objects in the current map.
  • Available actions: Controls the actions that will be available for submission from the widget. Choose the Some option to manually specify the available actions, along with an action config that can leverage module variables as default parameter values.
  • On selected action application: Configure Workshop events to trigger when any action is successfully applied within the widget.

  • Interface

  • Show layers panel: Display the layers panel within the map widget interface.
  • Show histogram: Display the histogram panel to enable filtering the map by object type or property.
  • Show series panel: Display the series panel on the bottom of the map interface.
  • Incomplete inputs message: When a map template cannot run due to missing required inputs, this message is displayed to the user in a dialog.
  • Enable image export to clipboard: Allow users to export an image of the map to their clipboard.
  • Filter rendered objects: When set, allow users to filter the displayed objects on the Map via an Object set filter variable.
  • Saving settings: Enable to allow the user to save the current map.
    • When the embedded resource is a map template, saving will create a new map resource.
    • This map will be given the name specified by Default resource name and be placed in the folder given by Default folder. If Show resource dialog is enabled, the user will be prompted to pick a resource name and location, with the configured name and folder being shown as a starting point in the resource dialog.
    • If a map is successfully created, the events and/or ontology Action defined in On create new map will be triggered. If you wish to use the created map RID as an input to an Action parameter, use the special Saved map RID option in the parameter input picker. Note that all required parameters must be configured with a defined default value, as no Action form will be shown to the user.
    • When the embedded resource is a map, saving will simply update the embedded map resource, rather than creating a new resource.

:::callout{theme="neutral"} Previously, template inputs were supplied using a single input object set variable that contained all the required object types defined in the map template. This is now discouraged as it only works for templates without non-object parameters and one object parameter per object type. If you wish to use this feature regardless, select the Use legacy input object set checkbox and supply an object set variable. :::


中文翻译


在 Workshop 模块中嵌入地图模板

地图模板可嵌入到 Workshop 模块中。其参数值可直接通过 Workshop 变量传递。

在 Workshop 模块中嵌入地图模板需执行三个步骤:

  1. 在 Workshop 中添加地图组件
  2. 选择资源
  3. 配置组件

在 Workshop 中添加地图组件

在 Workshop 模块的任意区域中,点击 + 图标或 + 添加组件 打开组件菜单,搜索 地图组件

选择资源

在组件编辑器的 图层 部分,选择 导入地图模板 而非默认的 本地配置。在 资源 设置下,点击 选择 查看兼容资源列表,并选择要嵌入的地图模板资源。

配置组件

对于 地图 组件,本地配置与嵌入模板的大部分配置选项相同。常规配置请参考 地图组件文档。以下组件设置仅适用于嵌入模板配置:

  • 图层
  • 资源: 选择要嵌入的地图模板资源。可选择提供 覆盖地图 RID。若提供此参数,将显示现有地图而非使用模板及其参数生成的默认地图。此功能支持加载对象属性中保存的 RID 对应的现有地图等操作。
  • 参数: 使用 Workshop 变量为模板参数提供值。
  • 刷新键: 当此变量值发生变化时,组件将完全重新加载地图。
  • 底图选择器: 控制默认背景地图图像。启用 显示底图选择器 开关后,用户可通过地图组件界面编辑底图。
  • 从场景加载数据: 使用场景而非基础 Ontology 加载指定资源。
  • 应用场景后重新生成地图: 启用后,每次场景修改后地图将自动刷新。

  • 交互

  • 选中对象: 输出当前选中对象的对象集。该对象集可在当前模块的下游组件中使用。
  • 选中对象变化时: 配置当地图上选中对象发生变化时触发的 Workshop 事件。例如,触发器可打开一个抽屉视图,显示选中对象的详细信息。
  • 地图上所有可见对象: 输出当前地图中可见对象的对象集。
  • 可用操作: 控制组件中可提交的操作。选择 部分 选项可手动指定可用操作,并配置可引用模块变量作为默认参数值的操作配置。
  • 选中操作应用时: 配置当组件内成功应用任何操作时触发的 Workshop 事件。

  • 界面

  • 显示图层面板: 在地图组件界面中显示图层面板。
  • 显示直方图: 显示直方图面板,支持按对象类型或属性过滤地图。
  • 显示序列面板: 在地图界面底部显示序列面板。
  • 输入不完整提示信息: 当地图模板因缺少必要输入而无法运行时,通过对话框向用户显示此信息。
  • 启用图像导出到剪贴板: 允许用户将地图图像导出到剪贴板。
  • 过滤渲染对象: 启用后,允许用户通过 对象集过滤 变量过滤地图上显示的对象。
  • 保存设置: 启用后允许用户保存当前地图。
    • 当嵌入资源为地图模板时,保存将创建新的地图资源。
    • 该地图将使用 默认资源名称 指定的名称,并放置在 默认文件夹 指定的文件夹中。若启用 显示资源对话框,系统将提示用户选择资源名称和位置,配置的名称和文件夹将作为资源对话框的起始选项。
    • 若地图创建成功,将触发 创建新地图时 定义的事件和/或 Ontology 操作。若希望将创建的地图 RID 作为操作参数的输入,请在参数输入选择器中使用特殊的 已保存地图 RID 选项。请注意,所有必需参数必须配置已定义的默认值,因为不会向用户显示操作表单。
    • 当嵌入资源为地图时,保存将直接更新嵌入的地图资源,而非创建新资源。

:::callout{theme="neutral"} 此前,模板输入通过包含地图模板中所有必需对象类型的单一输入对象集变量提供。此方法现已不推荐使用,因为它仅适用于不含非对象参数且每个对象类型仅含一个对象参数的模板。若仍需使用此功能,请勾选 使用旧版输入对象集 复选框并提供对象集变量。 :::