Reputation: 5917
I am trying to make this map work on a touchscreen (WebGL must be enabled).
With Firefox on Android it works fine. But with Chrome, initially, if I touch the screen it works, but if I release the screen and touch it again quickly (less than 1 or 2 seconds after I released the screen), no touchmove
event is triggered. If I wait long enough, I receive the touchmove
event correctly.
Here is some relevant code (sorry, I cannot provide the complete source code):
canvas.on('touchstart', function() {
//init drag
e.preventDefault();
return false;
});
canvas.on('touchmove', function() {
//move the map
e.preventDefault();
return false;
});
canvas.on('touchend', function() {
//stop drag
e.preventDefault();
return false;
});
I tried with and without preventDefault
or return false
, with no success. What did I miss ?
You can reproduce this issue with Chrome for Android, enabling WebGL first (go to chrome://flags
and enable WebGL), here or here for a more beautiful view.
Upvotes: 2
Views: 2720
Reputation: 3485
It feels like your app is blocking on touchEnd. The touchmove works again right after the address bar is updated why new coordinates. Could it be something wrong with the window.location.replace ? I experienced a similar blocking on a website using hardware accelerated features during a window.location.replace.
Upvotes: 3