M
M
My joy2019-12-27 14:28:34
JavaScript
My joy, 2019-12-27 14:28:34

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);
...

Tell me my hands are crooked or the plugin cannot be adapted to the mob?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question