0

我正在使用 Kepler.gl 进行反应项目。我有多边形的数据集,我希望它是透明的。我在 geoJson 中传递 opacity 属性

      {
      type: "Feature",
      geometry: {
        type: "Polygon",
        coordinates: [
          [
            [12.57638102369686, 55.68100585730289],
            [12.575605804451902, 55.68048395158776],
            [12.576431037841035, 55.680034919024024],
            [12.577447992118934, 55.68072844882596],
            [12.57638102369686, 55.68100585730289]
          ]
        ]
      },
      properties: {
        lineColor: [130, 154, 227],
        lineWidth: 0.05,
        opacity: 0.2,
        fillColor: [0, 0, 256],
      },
      id: uuid()
    },

然后由开普勒的geojson处理器处理

 const datasets = []
  dataSource.features.map((feature, index) =>
    datasets.push({
      info: {
        label: `${index}`,
        id: `${index}`
      },
      data: processGeojson(feature)
    })
  )
  useEffect(() => {
    dispatch(
      addDataToMap({
        datasets: datasets,
        options: {
          centerMap: true,
          readOnly: false
        },
        config: config
      })
    )
  }, [dataSource])

其他属性有效(lineColor、lineWidth 等)。它只是不透明度似乎没有做任何事情。

有人有同样的问题吗?

4

0 回答 0