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 57 57 activate: function() { 58 58 this.dragPan.activate(); 59 59 this.wheelHandler.activate(); 60 this.clickHandler.activate(); 60 61 this.zoomBox.activate(); 61 62 return OpenLayers.Control.prototype.activate.apply(this,arguments); 62 63 }, … … 67 68 deactivate: function() { 68 69 this.zoomBox.deactivate(); 69 70 this.dragPan.deactivate(); 71 this.clickHandler.deactivate(); 70 72 this.wheelHandler.deactivate(); 71 73 return OpenLayers.Control.prototype.deactivate.apply(this,arguments); 72 74 }, … … 75 77 * Method: draw 76 78 */ 77 79 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 }); 79 86 this.dragPan = new OpenLayers.Control.DragPan({map: this.map}); 80 87 this.zoomBox = new OpenLayers.Control.ZoomBox( 81 88 {map: this.map, keyMask: OpenLayers.Handler.MOD_SHIFT}); … … 96 103 defaultDblClick: function (evt) { 97 104 var newCenter = this.map.getLonLatFromViewPortPx( evt.xy ); 98 105 this.map.setCenter(newCenter, this.map.zoom + 1); 99 OpenLayers.Event.stop(evt);100 return false;101 106 }, 102 107 103 108 /**
