Answer the question
In order to leave comments, you need to log in
PaintOnMap.js not working on mobile?
Hi friends!
I connected this plugin to the map to draw the area https://tech.yandex.ru/maps/jsbox/2.1/polygon_custom
but it does not want to draw on the mobile. Changed the onmousemove event to ontouchmove, still doesn't help.
...
canvas.onmousemove = function (e) {
coordinates.push([e.offsetX, e.offsetY]);
ctx2d.clearRect(0, 0, canvas.width, canvas.height);
ctx2d.beginPath();
ctx2d.moveTo(coordinates[0][0], coordinates[0][1]);
for (var i = 1; i < coordinates.length; i++) {
ctx2d.lineTo(coordinates[i][0], coordinates[i][1]);
}
ctx2d.stroke();
}.bind(this);
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question