将边添加到 SceneLayer

尝试一下在线预览

这个例子展示了如何在 3D 中可视化一个 SceneLayer 为了更好地感知建筑物,它们的边缘也使用 SolidEdges3DSketchEdges3D 进行渲染。通过使用 视觉变量 ,根据 SceneLayer 的属性应用 色带 ,可以将主题数据可视化。

白色要素代表离公共交通车站较远的建筑物,深蓝色要素代表离公共交通车站很近的建筑物(步行时间少于 1 分钟)。颜色视觉变量设置在渲染器的 视觉变量 属性上。stops 属性通过将最小值和最大值映射到特定的颜色并插值中间值来设置一个颜色渐变。

                                                  
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Create the renderer and configure visual variables
const renderer = {
  type: "simple", // autocasts as new SimpleRenderer()
  // Add a default MeshSymbol3D. The color will be determined
  // by the visual variables
  symbol: {
    type: "mesh-3d",
    symbolLayers: [
      {
        type: "fill",
        material: {
          color: "#ffffff",
          colorMixMode: "replace"
        },
        edges: {
          type: "solid",
          color: [0, 0, 0, 0.6],
          size: 1.5
        }
      }
    ]
  },
  visualVariables: [
    {
      // specifies a visual variable of continuous color
      type: "color",
      // based on a field indicating the walking time to public transport
      field: "walkTimeToStopsInService",
      legendOptions: {
        title: "Walking time to public transport"
      },
      // color ramp from white to blue
      // based on the walking time to public transport.
      // Buildings will be assigned a color proportional to the
      // min and max colors specified below.
      stops: [
        {
          value: 1,
          color: "#2887a1",
          label: "less than 1 minute"
        },
        {
          value: 15,
          color: "#ffffff",
          label: "more than 15 minutes"
        }
      ]
    }
  ]
};

请记住,在具有视觉变量的数据驱动的可视化中使用的属性必须可以访问 SceneLayer 的缓存。将缓存属性的数量保持在最少可以提高 SceneLayer 的性能。因此,使用通过服务缓存提供的属性是最佳实践。

其他可视化示例和资源

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

The action has been successful