Skip to content

PB-97 : implement zoom to extent in 3D #599

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

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Conversation

pakb
Copy link
Contributor

@pakb pakb commented Jan 10, 2024

Small changes before the main commit : only export logging utils when shorthanded are defined, there could otherwise be some race conditions where a shorthanded is used before its definition, resulting in an uncaught error in the console (and an app crash if starting the app with Cesium)

The sync camera plugin was monodirectional, and wasn't reacting to changes made to the center or zoom (which is what is triggered when we do a zoomToExtent)

As this plugin is listening to mutation it triggers itself, I had to defend against infinite calls with some flagging inside the sync module.

I decided to revert the camera rotation on all axis when zooming to an extent, as I found it too difficult to calculate the equivalent without being straight into the Cesium viewer, and having access to function of the Cesium camera.

Test link

@pakb pakb requested a review from ltshb January 10, 2024 14:21
@github-actions github-actions bot added the bug label Jan 10, 2024
Copy link

cypress bot commented Jan 10, 2024

Passing run #232 ↗︎

0 161 19 0 Flakiness 0

Details:

PB-97 : add a source to setCenter, setZoom and setCameraPosition payload
Project: web-mapviewer Commit: 7e90116dbd
Status: Passed Duration: 03:44 💡
Started: Jan 15, 2024 3:24 PM Ended: Jan 15, 2024 3:27 PM

Review all test suite changes for PR #599 ↗︎

Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just one question and maybe a code improvement suggestion.

@pakb pakb force-pushed the bug_PB-97_zoom_to_extent_in_3d branch from 9ed86ec to 8a7421c Compare January 12, 2024 08:58
pakb added 3 commits January 15, 2024 16:09
there could otherwise be some race conditions where a shorthanded is used before its definition, resulting in an uncaught error in the console (and an app crash if starting the app with Cesium)
The sync camera plugin was monodirectional, and wasn't reacting to changes made to the center or zoom (which is what is triggered when we do a zoomToExtent)

As this plugin is listening to mutation it triggers itself, I had to defend against infinite calls with some flagging inside the sync module.

I decided to revert the camera rotation on all axis when zooming to an extent, as I found it too difficult to calculate the equivalent without being straight into the Cesium viewer, and having access to function of the Cesium camera.
making sure the sync camera plugins only reacts to setCenter and setZoom when 3D is active, otherwise it will write the camera also in 2D.

moving up the camera store param parsing, as it is now not required to have it after the 3D param parsing. And as the camera sync plunig now wants to have the 3D flag set to true to react to a setCenter, it's better dealing with both center and camera before the 3D flag is set up (less chances of race condition at app startup in the sync camera plugin this way)
@pakb pakb force-pushed the bug_PB-97_zoom_to_extent_in_3d branch from 8a7421c to 367c3fd Compare January 15, 2024 15:12
@pakb pakb requested a review from ltshb January 15, 2024 15:18
So that we can differentiate them in the 2D/3D sync plugin (and in the console debug logs) without the need for the 2D/3D sync plugin to declare many flags, rendering the code difficult to understand
@pakb pakb force-pushed the bug_PB-97_zoom_to_extent_in_3d branch from 367c3fd to 7e90116 Compare January 15, 2024 15:21
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks

@pakb pakb merged commit ac7f33e into develop Jan 15, 2024
@pakb pakb deleted the bug_PB-97_zoom_to_extent_in_3d branch January 15, 2024 15:44
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.

2 participants