diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 3222a86630..9326234ff2 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -65,6 +65,18 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { */ forceFixedZoomLevel: false, + /** + * Property: mouseDragStart + * {} + */ + mouseDragStart: null, + + /** + * Property: zoomStart + * {} + */ + zoomStart: null, + /** * Constructor: OpenLayers.Control.PanZoomBar */ @@ -85,6 +97,9 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { }); OpenLayers.Control.PanZoom.prototype.destroy.apply(this, arguments); + + delete this.mouseDragStart; + delete this.zoomStart; }, /** @@ -342,7 +357,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { if (!OpenLayers.Event.isLeftClick(evt)) { return; } - if (this.zoomStart) { + if (this.mouseDragStart) { this.div.style.cursor=""; this.map.events.un({ "mouseup": this.passEventToSlider, @@ -359,7 +374,6 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { zoomLevel += Math.round(deltaY/this.zoomStopHeight); } this.map.zoomTo(zoomLevel); - this.moveZoomBar(); this.mouseDragStart = null; OpenLayers.Event.stop(evt); }