From 7683e0853a92900836d3fc75169ddf6d5bf0b478 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Wed, 24 May 2006 03:20:22 +0000 Subject: [PATCH] Fix to Control.MouseDefaults stops panning when dragging off the map. Closes #29 for good, I hope. git-svn-id: http://svn.openlayers.org/trunk/openlayers@308 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/MouseDefaults.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Control/MouseDefaults.js b/lib/OpenLayers/Control/MouseDefaults.js index 189b0f5165..bd62e729b0 100644 --- a/lib/OpenLayers/Control/MouseDefaults.js +++ b/lib/OpenLayers/Control/MouseDefaults.js @@ -12,7 +12,7 @@ OpenLayers.Control.MouseDefaults.prototype = this.map.events.register( "mousedown", this, this.defaultMouseDown ); this.map.events.register( "mouseup", this, this.defaultMouseUp ); this.map.events.register( "mousemove", this, this.defaultMouseMove ); - //this.map.events.register( "mouseout", this, this.defaultMouseUp ); + this.map.events.register( "mouseout", this, this.defaultMouseOut ); }, /** @@ -33,10 +33,10 @@ OpenLayers.Control.MouseDefaults.prototype = this.zoomBox = OpenLayers.Util.createDiv('zoomBox'); this.zoomBox.style.border = '2px solid red'; this.zoomBox.style.backgroundColor = "white"; - this.zoomBox.style.filter = "alpha(opacity=35)"; // IE - this.zoomBox.style.opacity = "0.35"; + this.zoomBox.style.filter = "alpha(opacity=50)"; // IE + this.zoomBox.style.opacity = "0.50"; this.zoomBox.style.position="absolute"; - this.zoomBox.style.zIndex=1000; + this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1; this.zoomBox.style.top=this.mouseDragStart.y; this.zoomBox.style.left=this.mouseDragStart.x; this.map.viewPortDiv.appendChild(this.zoomBox); @@ -97,7 +97,13 @@ OpenLayers.Control.MouseDefaults.prototype = } this.mouseDragStart = null; this.map.div.style.cursor = "default"; - } + }, + defaultMouseOut: function (evt) { + if (this.mouseDragStart != null + && OpenLayers.Util.mouseLeft(evt, this.map.div)) { + this.defaultMouseUp(evt); + } + } });