[OpenLayers-Trac] [OpenLayers] #3606: Order of control activation affects handlers

OpenLayers trac-20090302 at openlayers.org
Fri Jan 13 06:24:27 EST 2012


#3606: Order of control activation affects handlers
-----------------------------------------------+----------------------------
 Reporter:  dify                               |       Owner:              
     Type:  bug                                |      Status:  new         
 Priority:  major                              |   Milestone:  2.12 Release
Component:  Control                            |     Version:  2.11        
 Keywords:  pan select control activate order  |       State:              
-----------------------------------------------+----------------------------
 For maps with Navigation and SelectFeature controls that have handlers
 with keymasks set, the order in which the controls are activated is
 important. In this case, the Navigation control must be activated before
 the SelectFeature control for the handlers to respect their keymask
 settings. Otherwise, when CTRL is pressed, the SelectFeature box drag
 handler works correctly, but the Navigation control also responds despite
 its handler keymask being set to OpenLayers.Handler.MOD_NONE.

 If this is a documented behaviour, I have not yet come across it. In my
 opinion, this is not an expected behaviour and should be considered a bug.


 {{{
 this.ctrlNav =
 this.map.getControlsByClass("OpenLayers.Control.Navigation")[0];
 this.ctrlNav.zoomBoxEnabled = true;
 this.ctrlNav.zoomBoxKeyMask = OpenLayers.Handler.MOD_SHIFT;
 this.ctrlNav.handlers.keyMask = OpenLayers.Handler.MOD_NONE;
 this.map.addControl(this.ctrlNav);
 this.ctrlNav.dragPan.handler.stopDown = false;
 this.ctrlNav.activate();

 this.ctrlSelectFeatures = new
 OpenLayers.Control.SelectFeature([this.lyrProductLOIs, this.lyrAllLOIs], {
 toggle: true, box: true, multiple: true, clickout: true });
 this.ctrlSelectFeatures.handlers.feature.stopDown = false;
 this.ctrlSelectFeatures.handlers.box.dragHandler.keyMask =
 OpenLayers.Handler.MOD_CTRL;
 this.map.addControl(this.ctrlSelectFeatures);
 this.ctrlSelectFeatures.activate();
 }}}

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


More information about the Trac mailing list