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
Multitouch zoom support in Windows 8 / IE10 #871
Comments
The file that handles touchzoom is: Check whether L.Browser.touch is true and that the touch events are being fired. Otherwise I'm not really sure, all of the other bits should be correct... |
Looked at the TouchZoom implementation under IE10. But unlike #870 this is not as easy to fix. The touchstart event seems to be WebKit only. IE10 needs another family of events http://stackoverflow.com/questions/6986490/will-does-ie10-support-touch-events. So this needs some extra code. |
Don't know how to map the MSPointer-event args to the WebKit args. There is an MS howto which explains how to support both IOS and IE10 http://blogs.msdn.com/b/ie/archive/2011/10/19/handling-multi-touch-and-mouse-input-in-all-browsers.aspx. I'll take a look at it and try to find out. But no matter how the IE pinch-zoom would be implemented, it needs an "-ms-touch-action: none" style. I would suggest to add this right now to leaflet.css, as this enables double-tap-zoom and drag-pan with the current version. .leaflet-container { |
@oliverheilig good findings! |
@oliverheilig thank you for your useful research! We don't have any Win8 devices here to test yet so I have to rely on contributions... |
We don't have a touch device either. I'm testing with virtual box and the Windows simulator which comes with VS-Express for Win8 http://msdn.microsoft.com/en-us/library/windows/apps/hh441475.aspx |
Will have a play with the sim in the next few days if you don't beat me to it, didn't think they'd have multitouch emulation, good job MS on that one! |
Hey guys, I ran into the same trouble and hotfixed it before I saw this discussion (or the issue list in general), and there's a pull request (https://github.com/CloudMade/Leaflet/pull/1019) that has the IE10 multitouch working. |
@veproza sounds amazing, thanks a lot! :) Will test the fix asap. |
Thanks for that PR @veproza I learnt a lot from it! If anyone who wants this could please go take a look and test it, It would be much appreciated!: I've put a built test online here: |
@danzel very nice! Tested it on an actual tablet and it works. But somehow i manage to bring the map into an inconsistent state when i touch wildly. Especially if the map doesn't run full screen like in your sample but within a panel of a metro app. I guess your touch-count doesn't work always correctly. Maybe you also have to consider MSPointerCancel, MSPointerOut, ... |
Yeah I think MSPointerCancel is probably the one, will update it today for another test. |
Pushed addition of MSPointerCancel and updated the test site. I also found what I hope is just a bug in the simulator: Place 2 fingers on the device (using the pinch zoom/touch mode option), move them to the edge of the screen so that one goes off and the Up event is fired.
Then you can get out the single touch tool and drag it around on the map for a random touch-zoom animation. |
Sorry to say this, but i can reproduce exactly the same behavior on an actual touch device. Set two finger on the device and move them outside -> i'm in a one-finger pinch-mode. |
FFFFFFFFUUUUUUU IE10. Will do some investigation. |
Can't find anything on google about this. Have pushed a hopeful fix (sample updated too). If there is a MSPointerUp with a pointerId that we don't know about then we nuke all of the touch events. This sorts it in the simulator, please test on device! |
I still can provoke inconsistencies. Another issue is that i sometimes get an 'Invalid calling object' in DomEvent:stopPropagation. Maybe i can dive deeper into it next week and add some log output. |
Do you have a reliable way to get in to an inconsistent state? (Like the one I posted above) |
No, i don't see any pattern. I cannot reproduce the behavior you postet before anymore, but after a while of heavy touching i get either the "invalid calling object" exception or i stay i a pinch-mode with one finger. Another issue is that the double-tap zoom doesn't work reliable. I'm testing with a Viewsonic Viewpad 10 and Leaflet hostet within a Windows 8 Metro app. But i think these are generic IE10 touch issues which affect any IE10/touch environment. |
A stack trace from "invalid calling object" would be useful if you could get one please. |
@danzel Nice job! I've gotten some time again, and I have spotted an issue with clicking on overlays/markers in IE, that it mostly does not register properly. Works in simulator, breaks on real (possibly only low-performance) machines. |
Got it working and could not get it into any inconsistent states anymore. See commits |
@veproza thanks, going to test it on monday on an actual tablet when i'm back in office. |
Awesome @veproza Have pulled both of those in to my branch. I've tidied up the click simulation a bit. We need to fire the dragend event (as we've fired dragstart). I think it makes sense to fire the click event after the drag finishes too. Have updated my debug page with these changes. |
Hey guys, it's getting better and better. There's only one more issue i can easily reproduce.
I have a test with the latest version from @danzel running |
While investigating the touch and drag off bug I discovered some stupid things I was doing with addEventListener. I've fixed these up (which let me get rid of the losing touches hack) and have fixed up touch and drag off too. |
Really great work guys! Keep it up! |
@danzel I've updated my sample at http://80.146.239.139/VectorTest/ie10test.html and it works flawless! But i have an issue when running inside a Metro App. When i push a zoom button i get an exception 'Property "0" of an undefined object cannot be called' inside onTouchStart(e) of DomEvent.DoubleTap.js at touch = e.touches[0]; I can only reproduce this behavior inside a metro app but not inside the browser. |
I've hotfixed it for my tests in DomEvent.DoubleTap.js function onTouchStart(e) {
if (!(e.touches) || e.touches.length === 0) {
return;
} This fixes the problem. But i spotted another issue which can be reproduced on http://80.146.239.139/VectorTest/ie10test.html
|
If I go off the left side of the map it doesn't break, but going off the left it does, ha! Will fix up now if I can figure it out |
Alright, both of those are fixed up proper now. I (again) think we should be all good! |
Woot! @danzel, feel free to merge into master then. |
Awesome, will look at merging later today :-) |
…DomEvent.DoubleTap). DoubleTap touch on IE10 doesn't currently work but everything else does. Refs Leaflet#871
Have landed my changes in leaflet master. (Changelog and build updated too.) |
So this is considered clsed, right? Really awesome work guys, thanks a lot! |
Oh whoops, must of missed the button :-) |
Hi guys, you have done amazing work! I now tested the map on Windows 8 tablet (Acer Iconia TAB W500) and in general the zooming works really well. I noticed however one glitch: When ending multitouch zoom, the map regularly "jumps" a bit before drawing the correct zoom level. When I tested it in Chrome browser on same device, the map smoothly moves to the correct zoom level. I recorded a screencast of the problem. In the video, the problem is not so clearly visible (as the video is not as fluent as actual device). In the video, I first zoom in and out with Chrome, then with IE 10 and then again with Chrome. As you hopefully can see, in Chrome the zoom end is smooth, but with IE 10, the zoom end "jumps" in most of the cases. The video is here: http://www.screencast.com/t/JkwCfKhuSJ Any idea what could cause this? |
That is a bit weird. I can reproduce this locally occasionally. Seems to only happen on a touch-zoom-in, but not on a touch-zoom-out or any other zoom. |
True, seems to be limited to zoom in.. |
…DomEvent.DoubleTap). DoubleTap touch on IE10 doesn't currently work but everything else does. Refs Leaflet#871
…DomEvent.DoubleTap). DoubleTap touch on IE10 doesn't currently work but everything else does. Refs Leaflet#871
I'm running Windows 8 with IE10 and noticed that multitouch zoom does not work on my multitouch tablet (Asus EP121)
Since I need this to work for a new project, I'm looking into resolving this myself. Any help appreciated though!
The text was updated successfully, but these errors were encountered: