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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user