Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] bearing not supported for controlled components #2210

Open
colemars opened this issue Jun 21, 2023 · 3 comments
Open

[Bug] bearing not supported for controlled components #2210

colemars opened this issue Jun 21, 2023 · 3 comments
Labels

Comments

@colemars
Copy link

colemars commented Jun 21, 2023

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 colemars added the bug label Jun 21, 2023
@Pessimistress
Copy link
Collaborator

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.

@colemars
Copy link
Author

colemars commented Jun 22, 2023

bearing.mp4

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

@Pessimistress
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants