OpenLayers OpenLayers

Ticket #1068: navigation_clickhandler.patch

File navigation_clickhandler.patch, 1.7 kB (added by crschmidt, 1 year ago)
  • lib/OpenLayers/Control/Navigation.js

    old new  
    5757    activate: function() { 
    5858        this.dragPan.activate(); 
    5959        this.wheelHandler.activate(); 
     60        this.clickHandler.activate(); 
    6061        this.zoomBox.activate(); 
    6162        return OpenLayers.Control.prototype.activate.apply(this,arguments); 
    6263    }, 
     
    6768    deactivate: function() { 
    6869        this.zoomBox.deactivate(); 
    6970        this.dragPan.deactivate(); 
     71        this.clickHandler.deactivate(); 
    7072        this.wheelHandler.deactivate(); 
    7173        return OpenLayers.Control.prototype.deactivate.apply(this,arguments); 
    7274    }, 
     
    7577     * Method: draw 
    7678     */ 
    7779    draw: function() { 
    78         this.map.events.register( "dblclick", this, this.defaultDblClick ); 
     80        this.clickHandler = new OpenLayers.Handler.Click(this,  
     81                                        { 'dblclick': this.defaultDblClick }, 
     82                                        { 
     83                                          'double': true,  
     84                                          'stopDouble': true 
     85                                        }); 
    7986        this.dragPan = new OpenLayers.Control.DragPan({map: this.map}); 
    8087        this.zoomBox = new OpenLayers.Control.ZoomBox( 
    8188                    {map: this.map, keyMask: OpenLayers.Handler.MOD_SHIFT}); 
     
    96103    defaultDblClick: function (evt) { 
    97104        var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );  
    98105        this.map.setCenter(newCenter, this.map.zoom + 1); 
    99         OpenLayers.Event.stop(evt); 
    100         return false; 
    101106    }, 
    102107 
    103108    /**