CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.94k stars 3.49k forks source link

Help should default to touch if mobile is detected #5631

Open ggetz opened 7 years ago

ggetz commented 7 years ago

The navigation help panel 'Touch' tab should be active initially if the browser detects user is using a mobile device.

hpinkos commented 7 years ago

We discussed this when I added touch instructions to the navigation help widget. Unfortunately, there's no standard way to determine whether the browser is on a mobile device. We can't just rely on whether the browser has touch events because there are computers with touch screens that have both touch and mouse controls, in which case I think we would want to show the mouse instructions by default.

It might be worth checking for the most common mobile devices (checking for mobile safari/mobile chrome/mobile firefox will account for the majority of users), but there's no way to guarantee you'll get 100% of mobile devices.

pjcozzi commented 7 years ago

non-100% would be OK.

It may be overkill to include a third-party until we need this check more widely, but I believe a lot of people use this: https://hgoebl.github.io/mobile-detect.js/