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

PB-154: Geolocation device orientation (gyroscope) - #minor #1022

Merged
merged 21 commits into from
Sep 2, 2024

Conversation

ltshb
Copy link
Contributor

@ltshb ltshb commented Aug 7, 2024

This PR replaced the initial work of #965

Testing slack canvas: https://swisstopo.slack.com/docs/TG623EKS6/F07GV0DQS7L

It also fixes some bugs related to goelocation see commits.

Because of some issues with some android devices (mostly samsung devices), the device orientation is only enabled on device where we can be sure that it works well, meaning Iphone and Pixel phone.

Test link

Test link

@github-actions github-actions bot changed the title PB-154: Geolocation device orientation (gyroscope) PB-154: Geolocation device orientation (gyroscope) - #minor Aug 7, 2024
@ltshb ltshb added the WIP label Aug 7, 2024
Copy link

cypress bot commented Aug 7, 2024

web-mapviewer    Run #3168

Run Properties:  status check passed Passed #3168  •  git commit 3b52e3214e: PB-154: Adapted the debug backend tool look
Project web-mapviewer
Branch Review feat-PB-154-geolocation-orientation
Run status status check passed Passed #3168
Run duration 05m 06s
Commit git commit 3b52e3214e: PB-154: Adapted the debug backend tool look
Committer Brice Schaffner
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 210
View all changes introduced in this branch ↗︎

@ltshb ltshb force-pushed the feat-PB-154-geolocation-orientation branch 7 times, most recently from f849e0b to 565fa25 Compare August 12, 2024 09:50
@ltshb ltshb removed the WIP label Aug 12, 2024
@ltshb ltshb marked this pull request as ready for review August 12, 2024 15:13
@ltshb ltshb force-pushed the feat-PB-154-geolocation-orientation branch 2 times, most recently from 30a20ff to 91fd823 Compare August 13, 2024 05:46
@schtibe
Copy link
Contributor

schtibe commented Aug 13, 2024

As discussed with @ltshb, Absolute Listener with Alpha Value is OK on
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36

@ltshb ltshb force-pushed the feat-PB-154-geolocation-orientation branch from cb0b68c to b9b50b6 Compare August 26, 2024 05:18
@ltshb ltshb requested a review from pakb August 26, 2024 08:00
@ltshb ltshb force-pushed the feat-PB-154-geolocation-orientation branch 2 times, most recently from 993aca2 to f296c97 Compare August 27, 2024 18:23
@pakb pakb changed the base branch from master to develop August 29, 2024 06:14
Make it more concise in order to use it also on smaller screen. For device
orientation we will need a new button, so we need to make some room to avoid
having the button off screen.

Also removed useless 3d debugs, they are now in the regular menu.
The initial geolocation might be invalid which creates a crash error, so we avoid it.
Not all devices uses the same orientation events, therefore added both.
Due to the moveend event that set the center when the user moved the
map by pressing/touching the map and a geolocation arrived during the move operation
the disabled tracking did not work as expected and the map was re-centered
canceling the move action of the user.

So now we are listening to the pointerdrag that happens as soon as we start to
drag and not when dragging is finished. Also moveend happened not only when the
using moved the map, but has soon as the map moved even programmatically.
When the goelocation tracking is disabled a dot in the icon is added in order
to provide a user feedback on how to re-center the map
ltshb and others added 15 commits September 2, 2024 07:06
This improved reactivity and performance
We had some case with infinite loop due to heading wrapping in 3D where
cesium reported heading 360 which was wrapped to 0 and triggered a dispatch
and a fly to which reported then back 360....
This kind of annoying especially if you want to recenter but keep your zoom.
Re-centering on position in 3D is more complex as in 2d because the of the camera.
If the pitch is not 90° then we need to compute the camera position in order
to have the position centered on the screen. For this moment we don't do this
computation and simply don't re-center the view on geolocation by disabling
geolocation tracking in 3D.
and move compass feedback to geolocation button component, linking them together visually on the UI
Keep the compass on in auto-rotation even if the map is north.
Auto rotation rotate the map using the geolocation as center and it doesn't make
sense to rotate if the location is not centered (this is also the same behavior
 as on the swisstopo app)
@ltshb ltshb force-pushed the feat-PB-154-geolocation-orientation branch from e0511cf to 3b52e32 Compare September 2, 2024 05:06
@ltshb ltshb merged commit 33bb150 into develop Sep 2, 2024
6 checks passed
@ltshb ltshb deleted the feat-PB-154-geolocation-orientation branch September 2, 2024 05:16
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.

3 participants