react-map-gl icon indicating copy to clipboard operation
react-map-gl copied to clipboard

[Bug] `bearing` not supported for controlled components

Open colemars opened this issue 2 years ago • 4 comments

Description

According to docs,

When Map is used as a controlled component, event.viewState.bearing reflects the zoom that the camera "proposes" to change to, as a result of either user interaction or methods such as flyTo. The camera does not actually change until the application updates the bearing prop.

In reality, event.viewState.bearing reports the current bearing.

Expected Behavior

event.viewState.bearing from onRotate should return "proposed" bearing

Steps to Reproduce

https://codesandbox.io/s/exciting-currying-fv7z84?file=/src/App.js

Attempt to rotate, see console

Environment

See codesandbox

Logs

No response

colemars avatar Jun 21 '23 05:06 colemars

What exactly is the bug here? The map in your app can be rotated, which shows that onRotate is called with the next bearing value.

Pessimistress avatar Jun 22 '23 15:06 Pessimistress

https://github.com/visgl/react-map-gl/assets/42340374/742718ad-e98d-4454-b305-8deb4489e8c8

@Pessimistress do you mind clarifying please? I can adjust pitch but rotate(bearing) is non functional in that app.

colemars avatar Jun 22 '23 17:06 colemars

I see, you are dragging the navigation control, not using ctrl+pan. I will look into it.

Pessimistress avatar Jun 22 '23 17:06 Pessimistress