我正在尝试使用以下代码获取坐标:如果我单击画布以获取 X 和 Y 位置:显示控制台错误:未捕获的 TypeError:无法读取未定义的属性“位置”
截图:http ://screencast.com/t/0LHAae5AicRz
viewer.addHandler('canvas-click', function (target, info) {
var viewportPoint = viewer.viewport.pointFromPixel(info.position);
var imagePoint = viewer.viewport.viewportToImageCoordinates(viewportPoint.x, viewportPoint.y);
console.log(imagePoint.x, imagePoint.y);
});