deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Bug] getAngle transition goes wrong direction at 359 <-> 1

Open Fabioni opened this issue 1 year ago • 1 comments

Description

using something like:

new IconLayer({
    id: "test",
    data: DATA,
    getAngle: d => d.angle,
    transitions: {
        getAngle: 50,
    }
})

this breaks when the angle switched from 350 to 10 because the transition does not do 351, 352, ... 0, 1, 2 but it does 349, 348, ..., 12, 11, 10.

Flavors

  • [ ] Script tag
  • [X] React
  • [ ] Python/Jupyter notebook
  • [ ] MapboxOverlay
  • [X] GoogleMapsOverlay
  • [ ] CartoLayer
  • [ ] ArcGIS

Expected Behavior

Transition the getAngle property correctly.

Steps to Reproduce

I omit a coderpad for now, because I think the bug is pretty self explanatory. Let me know if still needed.

Environment

  • Framework version: 9.0.27
  • Browser: Chrome

Logs

No response

Fabioni avatar Aug 20 '24 00:08 Fabioni

The current attribute transition logic is very generic so it does not understand that "angle" is something that loops around. Before a proper fix, I think you can pass 370 instead of 10 as a work around.

Pessimistress avatar Aug 30 '24 17:08 Pessimistress