Skip to content

Improve mobile navigation in 3D#543

Merged
pakb merged 1 commit intodevelopfrom
feat_cesium_mobile_nav_improvements
Nov 23, 2023
Merged

Improve mobile navigation in 3D#543
pakb merged 1 commit intodevelopfrom
feat_cesium_mobile_nav_improvements

Conversation

@pakb
Copy link
Contributor

@pakb pakb commented Nov 22, 2023

I found that most (of not all) Cesium sandcastles (online examples) have this CSS rule to block touch action, it fixes all issues I experienced with panning while on a mobile device!

I also de-activated the location popup (right-click) on mobile, as it wasn't very consistent how to trigger a right click with a touch screen.

Test link

@pakb pakb requested a review from ltshb November 22, 2023 12:39
I found that most (of not all) Cesium sandcastles (online examples) have this CSS rule to block touch action, it fixes all issues I experienced with panning while on a mobile device!

I also de-activated the location popup (right-click) on mobile, as it wasn't very consistent how to trigger a right click with a touch screen.
@pakb pakb force-pushed the feat_cesium_mobile_nav_improvements branch from 8b1bf0a to 324c11f Compare November 22, 2023 12:40
@ltshb
Copy link
Contributor

ltshb commented Nov 22, 2023

A quick test showed that the location popup on 3d on mobile is still available on long press and a bit buggy. Otherwise the navigation in 3d on mobile seems to work quite well, well done. I'll do the review tomorrow morning.

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.

The code looks good thanks. The 3d in mobile is definitively much better.
However le location popup in 3d has still some issues:

  • sometimes it disappear on touch stop
  • sometimes it also select the whole map

In the PR comment you added a notice that the location popup is disabled in 3d mobile, it is not but it might be the solution, or at least for the moment ?

Comment on lines +540 to +545
if (event.touches.length === 1) {
this.contextMenuTimeoutId = setTimeout(() => {
const touch = event.touches[0]
this.onContextMenu(touch)
}, 500)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Here it would be good to use a constant LONG_PRESS_TIMEOUT = 500

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.

As discussed in daily, all good for now

@pakb pakb merged commit b5746ea into develop Nov 23, 2023
@pakb pakb deleted the feat_cesium_mobile_nav_improvements branch November 23, 2023 08:57
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