304Arcgis_for_js热力图4.21(03)

1,使用FeatureLayer创建热力图
目前 HeatmapRenderer 还不支持在SceneViews中使用,只能在二维点图层中使用

//热力图渲染
    let heatmap_style = {
      type: "heatmap",
      colorStops: [
        { color: "rgba(63, 40, 102, 0)", ratio: 0 },
        { color: "#472b77", ratio: 0.083 },
        { color: "#4e2d87", ratio: 0.166 },
        { color: "#563098", ratio: 0.249 },
        { color: "#5d32a8", ratio: 0.332 },
        { color: "#6735be", ratio: 0.415 },
        { color: "#7139d4", ratio: 0.498 },
        { color: "#7b3ce9", ratio: 0.581 },
        { color: "#853fff", ratio: 0.664 },
        { color: "#a46fbf", ratio: 0.747 },
        { color: "#c29f80", ratio: 0.83 },
        { color: "#e0cf40", ratio: 0.913 },
        { color: "#ffff00", ratio: 1 }
      ],
      maxPixelIntensity: 25,
      minPixelIntensity: 0
    };

 let artificialPatrol_ly = new FeatureLayer({
      title: "artificialPatrol_ly",
      fields: [
        {
          name: "ObjectID",
          alias: "ObjectID",
          type: "oid",
        },
        {
          name: "id",
          alias: "id",
          type: "string",
        },
        {
          name: "fileName",
          alias: "fileName",
          type: "string",
        }
      ],
      objectIdField: "ObjectID",
      geometryType: "point",
      outFields: ["*"],
      spatialReference: this.m_spatialReference,
      source: [],
      renderer: heatmap_style
    });
    this.map.add(artificialPatrol_ly);

利用开源heatmap结合arcgis api for js实现
自定义HeatmapLayer类,继承DynamicMapServiceLayer,然后结合heatmap.js一起
这个之前在3.X中用过。4.X中没这么使用过

你可能感兴趣的:(304Arcgis_for_js热力图4.21(03))