Skip to content

Conversation

@Shasan634
Copy link
Contributor

@Shasan634 Shasan634 commented Nov 29, 2025

Background

Map views get un-synced when dataset has default view. The bug occurs when user

  1. Toggle compare datasets and select CIOPS E
  2. Un-toggle compare datasets and move the map a bit
  3. Re-toggle compare datasets and note that the maps will be focused on different areas and can be moved independently of each other

What approach was taken?

For compare mode, used to hold previous mapView state in a React state variable when creating the second map (map1). However, this state variable was not updated when users panned or zoomed the map, causing it to become stale. When toggling compare mode off and back on, map1 would be recreated using this outdated mapView state rather than map0's current view position, resulting in the maps displaying different areas.
The fix was to directly retrieve map0's current view using map0.getView() when creating map1, ensuring both maps share the same viewport regardless of any intermediate navigation that occurred while compare mode was disabled.

Anything in particular that should be highlighted?

For datasets with default location, the view moves to that location. Should map0 be used as a reference for default location?

Checks

  • I ran unit tests.
  • I've tested the relevant changes from a user POV.
  • I've formatted my Python code using black ..

Hint To run all python unit tests run the following command from the root repository directory:

bash run_python_tests.sh

@Shasan634 Shasan634 self-assigned this Nov 30, 2025
@Shasan634 Shasan634 added Bugfix A fix for something broken. Javascript Bug Something's wrong. labels Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something's wrong. Bugfix A fix for something broken. Javascript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants