带有IE11的ol3在C#Webbrowser控件中的鼠标单击事件不起作用 [英] ol3 with IE11 in a c# webbrowser control mouse click events not working

查看:125
本文介绍了带有IE11的ol3在C#Webbrowser控件中的鼠标单击事件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Webbrowser控件将c#应用程序中的浏览器升级"到IE 11.

I've "upgraded" to IE 11 for the browser inside a c# application using the webbrowser control.

当我将网页加载到IE 11浏览器中时,所有内容都可以在地图上正常运行.

When I load my web page into the IE 11 browser natively everything works properly on the map.

当我使用C#应用程序时,所有内容都会正常加载,但不能单击地图并将其拖动.

When I'm in the c# application everything loads without error except that I can not click on the map and drag it.

我所有的地图点击事件也不会触发.

All of my map click events will also not fire.

我可以使用箭头键移动地图,并且滚轮鼠标也可以使用.

I can use the arrow keys to move the map, and the wheel mouse also works.

我注意到,当我本机使用IE 11并将开发人员工具与对所有异常破坏"一起使用时,在ol3中检查其PointerEvent.HAS_BUTTONS是否受支持时会出现错误,表示Object不支持此功能.行动.

I have noticed that when I use IE 11 natively, and use the developer tools with "Break on all exceptions", I get an error in ol3 when its checking if PointerEvent.HAS_BUTTONS is supported, saying Object doesn't support this action.

使用ol-3.4.0在ol-debug.js的44619行出现错误

error is on line 44619 of ol-debug.js, using ol-3.4.0

注意:是的,我已经为我的应用程序名称的32位和64位键以及为该应用程序的vhost.exe版本的浏览器仿真设置了正确的注册表值.

Note: Yes, I've set the proper registry values for the browser_emulation for both the 32 bit and 64 bit keys for my application name, and the one for the vhost.exe version of the application.

更新:

我还应该注意,如果我使用

I should also note that if I use

map.on('click', function(e) { 
    //do stuff
    });

什么都没有触发...但是,如果我使用jquery并执行

there is nothing fired... However, if I use jquery and do

$(map.getViewport().on('click', function(e) {
//do stuff
});

...然后我的点击事件起作用了....

... then my click events work....

推荐答案

因此,我决定回滚到IE10.一切都可以在本机浏览器和WebBrowser控件中运行.

So, I decided to roll back to IE10. Everything works in both the native browser and in the WebBrowser control.

IE11破坏了太多内容,因此目前不值得进行升级".

IE11 breaks too much stuff, and isn't worth the "upgrade" at this point in time.

将来我将检查CefSharp,只是没有足够的时间发布到即将发布的版本中.

I will be checking out CefSharp in the future, just not enough time to put into upcoming release.

这篇关于带有IE11的ol3在C#Webbrowser控件中的鼠标单击事件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆