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

OpenLayers trac-20090302 at openlayers.org
Sat Nov 20 17:57:31 EST 2010


#2941: OpenLayers.Control.Navigation with documentDrag enabled removes all
document events.
--------------------------+-------------------------------------------------
 Reporter:  mgleahy       |       Owner:              
     Type:  feature       |      Status:  new         
 Priority:  minor         |   Milestone:  2.11 Release
Component:  Handler.Drag  |     Version:  2.10        
 Keywords:                |       State:              
--------------------------+-------------------------------------------------
 Currently, the OpenLayers.Handler.Drag class used by the Navigation
 control uses the OpenLayers.Events.destroy() method when the documentDrag
 option is enabled after a user drags the map outside of the map element's
 boundaries.

 This destroy() method has the result of removing all events for the
 element in question (in this case, the document element).  As a result,
 other controls that rely on document events (e.g., the KeyboardDefaults
 control) will stop working once this has happened at least once.

 The patch that I'll attach to this ticket switches tactics in the Drag
 class, such that it uses the OpenLayers.Events.un() method to unregister
 the only the events used by the Navigation control, and instead of
 creating the documentEvents object each time the user leaves the map, it
 keeps it and just calls the on() un() methods as users move the mouse out
 of the map when dragging.

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


More information about the Trac mailing list