Openlayers 4 在鼠标单击时出现错误的像素
Openlayers 4 getting wrong pixel on mouse click
我正在使用打开的 ImageStatic layers.I 正在将以下范围传递给投影
this.extent = [0, 0, 2800, 1280];
我也使用下面的代码获取地图上的像素点击
this.map.on('click', function (evt) {
console.log(evt);
});
但是我点击地图时的 x 和 y 坐标值与原始 x,y 位置相比不正确
我错过了什么吗?
fiddlelink
调试代码后我发现投影的默认坐标从左下角开始(Y 向上)
我用 openlayers
的 axisOrientation 属性 解决了这个问题
我正在使用打开的 ImageStatic layers.I 正在将以下范围传递给投影
this.extent = [0, 0, 2800, 1280];
我也使用下面的代码获取地图上的像素点击
this.map.on('click', function (evt) {
console.log(evt);
});
但是我点击地图时的 x 和 y 坐标值与原始 x,y 位置相比不正确
我错过了什么吗? fiddlelink
调试代码后我发现投影的默认坐标从左下角开始(Y 向上)
我用 openlayers
的 axisOrientation 属性 解决了这个问题