【问题标题】:deck.gl get color of TripsLayerdeck.gl 获取 TripsLayer 的颜色
【发布时间】:2020-01-12 14:07:02
【问题描述】:

layers.push(new TripsLayer({
        id: 'trips',
        data: trips,
        getPath: (d: Trip) => d.segments.map((p: Waypoint) => p.coordinates),
        getTimestamps: (d: Trip) => d.segments.map((p: Waypoint) => p.timestamp),
        getColor: (d: Trip) => d.segments.map((p: Waypoint) => p.color),//this.getColor,
        opacity: 0.3,
        widthMinPixels: 5,
        trailLength,
        currentTime
      

Deck.gl 只显示一个行程,我想让行程的每个坐标都有不同的颜色。但颜色不随地点和时间的变化而变化,通常为黑色。 我在trips.json中设置了color的属性,可以列举如下:

【问题讨论】:

    标签: javascript json web deck.gl getcolor


    【解决方案1】:

    我也有类似的问题。我使用一个函数来设置颜色,它似乎只运行一次。 也许是因为getcolor 是“渲染选项”而不是“数据访问器”。 从: https://deck.gl/docs/api-reference/geo-layers/trips-layer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-25
      • 2017-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多