thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

Viewchange events not being raised in C# Options #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Attach a listener for any on of the viewchange events
2.Run the app
3.Change the view
4.the event is not being raised

What is the expected output? What do you see instead?
Expect the event to be raised once the event has been attached

What version of the product are you using? On what operating system?
Vista 64

Please provide any additional information below.
For some reason the view change events are not being raised in my c# 
code. I hook them up as follows; 

this.InvokeJavascript("jsAddEventListener",new object[] { (_ge.getView 
(), "viewchangeend"}); 

My listener is as follows; 

private void geWebBrowser1_KmlEvent(object sender, GEEventArgs e) 
{ 
bla bla bla 
} 

I am able to receive mouse events just not the viewchange events. I 
know this is a new feature but I have checked and seem to have up to 
date versions of everything. 

Original issue reported on code.google.com by robert.s...@lacota.com on 3 Nov 2009 at 10:16

GoogleCodeExporter commented 9 years ago
This is due to the GEGlobe object not returning a KmlEvent when the view events 
are 
raised. I will add additional methods to the controls to allow for these events 
to be 
used. Thanks for bringing this to my attention.

Original comment by fraser.c...@gmail.com on 3 Nov 2009 at 10:31

GoogleCodeExporter commented 9 years ago
...OK I am thinking of rewriting the whole of the events system as there are a 
number 
of other issues that need to be resolved. Please bear with me whilst I 
determine the 
best pattern to use so that all events can be integrated in the best way.

Original comment by fraser.c...@gmail.com on 3 Nov 2009 at 10:48

GoogleCodeExporter commented 9 years ago
Interestingly, I had the same problem but was able to get it to work using
InjectJavascript. 

{{{

                browser.InjectJavascript(@"
                    function eventHandler(event) {
                        if(event) {
                          application.KmlEventCallBack(event, event.getType());
                        }
                    }

                    // listen to the click event on the globe and window
                    google.earth.addEventListener(ge.getGlobe(), 'click', eventHandler);
                    google.earth.addEventListener(ge.getWindow(), 'click', eventHandler);
                ");

}}}

Original comment by blai...@gmail.com on 4 Nov 2009 at 11:03

GoogleCodeExporter commented 9 years ago
Ya, that is how I am handling custom events, however that wont work for the 
viewchangebegin viewchange or viewchangedend events on the GEView as the 
callback does 
not pass a KmlEvent object...Thanks though!

Original comment by fraser.c...@gmail.com on 4 Nov 2009 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by fraser.c...@gmail.com on 5 Nov 2009 at 1:44