-
Notifications
You must be signed in to change notification settings - Fork 42
fix: Fix map.set_view_state does not set pitch and bearing #1055
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
base: main
Are you sure you want to change the base?
Conversation
Previously, changing pitch and bearing using set_view_state or by clicking and dragging the map did not forward updates to Map.view_state. Added tests to verify. Closes developmentseed#1052
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially wrote an isMapView() check, as suggested #1052 (comment) but turns out view was always "undefined" when I created my maps with m = viz([])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the peculiarities of jupyter widgets, but these tests always passed, even with pitch and bearing specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some tests. This was fun to play around with.
Oddly, updating pitch/bearing with set_view_state and then calling view_state in the same cell correctly reflected the changes (in the text output, not on the map) but if view_state was instead called in a subsequent cell, pitch and bearing were not updated. This is my best attempt at testing that behavior, and the manual pitch/bearing adjustment behaviour.
Previously, changing pitch and bearing using set_view_state or by clicking and dragging the map did not forward updates to Map.view_state. Added tests to verify.
Closes #1052