问题描述
华为银河麒麟桌面操作系统V10或其他linux桌面浏览器浏览器使用openlayers开发的超图地图地图页面无法拖拽
原因分析:
通过跟踪调试openlayers源码ol-debug.js文件。主要原因是在某些操作系统浏览器鼠标事件(PointerEvent)获取的pointerId在鼠标每次离开浏览器再回来重新点击,鼠标事件的pointerId会自动加1,window操作系统不会默认都是1,导致根据pointerId获取的鼠标坐标都是同一个,从而使地图无法拖拽
解决方案:
修改源码
找到ol.interaction.Pointer.prototype.updateTrackedPointers_方法
将该方法修改成
ol.interaction.Pointer.prototype.updateTracke