更新要素属性

尝试一下在线预览

此示例演示如何使用 FeatureLayer.applyEdits() 更新现有要素的属性。此示例使用 FeatureForm 微件通过在用户选择视图上的要素时调用 applyEdits 函数来更新现有功能的属性。

表单的字段通过表单模板进行配置。此模板接受组合成组的字段元素数组 具有分组字段配置提供了更易于管理的编辑工作流程。此示例使用自动转换为组元素的嵌套元素。

                               
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
formTemplate: { // Autocasts to new FormTemplate
  title: "Damage assessments",
  description: "Provide information for insurance",
  elements: [
    { // Autocasts to new GroupElement
      type: "group",
      label: "Inspector Information",
      description: "Field inspector information",
      elements: [
        { // Autocasts to new FieldElement
          type: "field",
          fieldName: "inspector",
          label: "name"
        },
        {
          type: "field",
          fieldName: "inspemail",
          label: "Email address",
          visibilityExpression: "alwaysHidden" // reference to an expression defined under "expressionInfos"
        },
        {
          type: "field",
          fieldName: "insp_date",
          label: "Date of inspection"
        }
      ]
    }
  ]
}
...

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.