Steve Furey Steve Furey - 9 months ago 80
C# Question

ol3 with IE11 in a c# webbrowser control mouse click events not working

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

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

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.

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.

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

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

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

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

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

Answer Source

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

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

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