IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
283 stars 109 forks source link

Proper desktop mode #225

Open johnd0e opened 5 years ago

johnd0e commented 5 years ago

When I open intel in Chrome (android) I can switch desktop mode on.

In IITCm there is similar possibility: option Force desktop mode. But it not the same.

Let's compare some metrics related to width: window.innerWidth is related to viewport width. document.body.offsetWidth is related to full scrollable page width.

mode innerWidth offsetWidth
Chrome (intel mobile) 360 360
Chrome (intel full): 360 960
Chrome 'Desktop site' (intel mobile) (intel full) 980 980
IITCm 360 360
IITCm (Force desktop mode) 360 360

Physical resolution of my display: 1080, and window.devicePixelRatio === 3.

So what is wrong here: IITCm (Force desktop mode) is not desktop mode in any meaning.

johnd0e commented 5 years ago

So what can be improved here:

  1. Make 'Force desktop mode' closer to intel 'full': Allow map to be larger that viewport, but scrollable. Not sure though if it's easy with leaflet, as it may conflict with map dragging. (on google map there is two-finger drag)
  2. Implement real desktop mode, to have resolution more closer to physical screen ability.
johnd0e commented 5 years ago

IMHO 'real' desktop mode (like in Chrome) is essential, 'cause it has much higher pixel density. It may be not easy to interact with features with touchscreen, but:

I do not know how to switch to Desktop mode in webview, but we can try same approach as used in AdvancedWebView. It involves changing WebOptions with setUseWideViewPort, setLoadWithOverviewMode.

May be we also need to tune viewport meta: https://stackoverflow.com/questions/24209628/how-to-override-device-pixel-ratio