Meteor app produce a canvas page, touchmove event not work success


#1

I setup a canvas, and use mousemove event on computer browser. It works successful, but when I test on mobile device, I have a problem.

Here is my code, and I set some alert to get result.

‘touchmove #canvas’: function(event, template) {
var offset = $(’#canvas’).offset(); //alert a offset object, and the information correct.

var xAxisInCanvas = event.originalEvent.changedTouches[0].pageX - offset.left;   //alert a number, and it can get two numbers, also the calculation of two numbers is run successful.

var yAxisInCanvas = event.originalEvent.changedTouches[0].pageY - offset.top;   //alert a number, and it can get two numbers, also the calculation of two numbers is run successful.

var currentPoint = Points.findOne({$and: [{x: xAxisInCanvas}, {y: yAxisInCanvas}]});   //alert this is no problem and program can run continue.

if(Boolean(currentPoint) == true) {
    Meteor.call("removeOldPoint", currentPoint._id, function(error) {
        if(error) {console.log(error.message);}
    });
}   //alert this is no problem and program can run continue.

Meteor.call("insertNewPoint", xAxisInCanvas, yAxisInCanvas, "black", function(error) {
    if(error) {console.log(error.message);}
});  //alert the point could get successful, and meteor call run no error, also the callback function of meteor call is work successful.

},

But after this code, the point is not saved in server, and nothing display on canvas.

If change to mousemove event, event.pageX and event.pageY, then used it on computer browser was worked successful. When I test it with run mobile device, the canvas was nothing displayed. I don’t know what happen, please help me to solve it, thank you very much!!!