When canvas responds to the mousedown event, it can extract the internal coordinates of the element through event.offsetX and offsetY. Then I changed to touchstart and there is no offsetX and offsetY. Where should I find the internal coordinates of the element?
The algorithm processed in my canvas map library Sinomap is this (with changes):
Touch event, you need to get e.touches[0].pageX or other coordinates. As for touchend, for compatibility reasons, it is best to use e.changedTouches