From: Edwin C. <com...@gm...> - 2009-12-01 09:07:39
|
Hi David, First of all thanks for your previous contributions. I hope to soon have time to merge the user contributions into the main code base, but for now I am swamped with work unfortunately. It seems that you are mixing two questions in your question about the events. One about how GWT-OL abstracts OL events and one about OL events. In GWT-OL there is a wrapper of the OL event at a basic level of abstraction with the EventHandler, but this requires more knowledge of the user of the GWT-OL API. Therefore, a layer of abstraction has been build on top of the EventHandler that calls the EventHandler under the hood. Therefore, the second, higher layer of abstraction of OL events, builds on top of the basic abstraction and they are not two different things. GWT-OL events fired by controls and layers are specific for that layer, so not global. It could be that protocol HTTP returns a singleton and the effects are therefore global. I am not sure what you mean when you say 'when my wrapper was active'. The higher layer of abstraction of OL events also instrumented the registering and unregistering of events, because the EventListenerCollection keeps the information to do this. When a listener is unregistered that is registered via the EventListenerCollection it should no longer receive notifications of the event it was previously registered to. There is another way of listening to callbacks by the way, which is illustrated in org.gwtopenmaps.openlayers.client.control.SelectFeature. This uses the possibility to call "Java" code from javascript in GWT. This is useful if you are dealing with callbacks instead of events as thrown by the OL event object. Hope this is helpful for you. Greetings, Edwin 2009/11/30 David Potts <dav...@pi...>: > > Hi > > I trying to understand the event model used in gwt-openlayers > > As far as I understand it, there are two event models. > > The one based on openlayers register event, etc. > > The the model employed in gwt-openlayers, eg addMapClickListener from > Map.java. > > They are both based on the same code model, but I have an issue with the > openlayers one. > > I have written a wrapper for the OpenLayers.Protocol.HTTP function. Its > it provides several callback interfaces. In my wrapped version I support > both the use of the callback paramter and an addProtocol style function. > > As I expected when ever I accessed a file the callback function for the > success event fired. > > BUT my callback function installed by the gwt-openlayers function fired > whenever a file protocol event fired, ie when ever openlayer opens a file > my protocol specfic callback function was called, instead of only being > called when my protocol wrapper was active. > > It seems that anycallback function installed by an openlayers Listener > function are global,ie not tied to a specfic instance off an object. Is > this the expect results or should objects only get events that they > created? > > The only reason thatI ask is that I want to wrap some of the > Handler(Hover,Box, MouseWheel, etc) objects which have an extensive > system off callbacks functions and I want to get the right interface. > > Dave > -- > Any views expressed in this message are those of the individual sender, > except where the sender specifically states them to be the views of the > Pinan Software > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |