Skip to content

Conversation

@jwardbond
Copy link

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

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
@github-actions github-actions bot added the fix label Dec 4, 2025
Copy link
Author

@jwardbond jwardbond Dec 4, 2025

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([])

Copy link
Author

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] map.set_view_state does not set pitch and bearing

1 participant