| | 34 | destroy: function() { |
|---|
| | 35 | |
|---|
| | 36 | if (this.handler) { |
|---|
| | 37 | this.handler.destroy(); |
|---|
| | 38 | } |
|---|
| | 39 | this.handler = null; |
|---|
| | 40 | |
|---|
| | 41 | this.map.events.unregister( "click", this, this.defaultClick ); |
|---|
| | 42 | this.map.events.unregister( "dblclick", this, this.defaultDblClick ); |
|---|
| | 43 | this.map.events.unregister( "mousedown", this, this.defaultMouseDown ); |
|---|
| | 44 | this.map.events.unregister( "mouseup", this, this.defaultMouseUp ); |
|---|
| | 45 | this.map.events.unregister( "mousemove", this, this.defaultMouseMove ); |
|---|
| | 46 | this.map.events.unregister( "mouseout", this, this.defaultMouseOut ); |
|---|
| | 47 | |
|---|
| | 48 | //unregister mousewheel events specifically on the window and document |
|---|
| | 49 | OpenLayers.Event.stopObserving(window, "DOMMouseScroll", |
|---|
| | 50 | this.wheelObserver); |
|---|
| | 51 | OpenLayers.Event.stopObserving(window, "mousewheel", |
|---|
| | 52 | this.wheelObserver); |
|---|
| | 53 | OpenLayers.Event.stopObserving(document, "mousewheel", |
|---|
| | 54 | this.wheelObserver); |
|---|
| | 55 | this.wheelObserver = null; |
|---|
| | 56 | |
|---|
| | 57 | OpenLayers.Control.prototype.destroy.apply(this, arguments); |
|---|
| | 58 | }, |
|---|
| | 59 | |
|---|
| | 60 | /** |
|---|
| | 61 | * |
|---|
| | 62 | */ |
|---|
| 49 | | OpenLayers.Event.observe(window, "DOMMouseScroll", |
|---|
| 50 | | this.onWheelEvent.bindAsEventListener(this)); |
|---|
| 51 | | OpenLayers.Event.observe(window, "mousewheel", |
|---|
| 52 | | this.onWheelEvent.bindAsEventListener(this)); |
|---|
| 53 | | OpenLayers.Event.observe(document, "mousewheel", |
|---|
| 54 | | this.onWheelEvent.bindAsEventListener(this)); |
|---|
| 55 | | |
|---|
| | 83 | OpenLayers.Event.observe(window, "DOMMouseScroll", this.wheelObserver); |
|---|
| | 84 | OpenLayers.Event.observe(window, "mousewheel", this.wheelObserver); |
|---|
| | 85 | OpenLayers.Event.observe(document, "mousewheel", this.wheelObserver); |
|---|