[OpenLayers-Trac] Re: [OpenLayers] #2941: OpenLayers.Control.Navigation with documentDrag enabled removes all document events.

OpenLayers trac-20090302 at openlayers.org
Sun Nov 21 05:52:03 EST 2010


#2941: OpenLayers.Control.Navigation with documentDrag enabled removes all
document events.
--------------------------+-------------------------------------------------
 Reporter:  mgleahy       |       Owner:              
     Type:  bug           |      Status:  new         
 Priority:  minor         |   Milestone:  2.11 Release
Component:  Handler.Drag  |     Version:  2.10        
 Keywords:                |       State:  Review      
--------------------------+-------------------------------------------------
Changes (by ahocevar):

  * state:  => Review


Comment:

 This seems to be a regression caused by r10873.

 I am attaching a patch that uses Event.observe/stopObserving. As mgleahy
 stated correctly, this is not as straightforward as it may seem, but it
 pays off: creating and destroying Events instances is relatively expensive
 compared to just observing events. My patch also moves the code for adding
 the observers to a separate addDocumentEvents method.

 The document-drag.html example still works as expected, and tests still
 pass. Thanks for any review.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2941#comment:6>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list