make it such that the map is dropped and the zoom box abandoned if the mouse goes off the screen. obviously the better solution would be to treat things as if we were still in the div -- mach 2 had this functionality. for now, however, we dont have time to code that, so i have created a ticket #263 and put it in the drawer for 2.2. this fix at least gives the user consistent behaviour, and does not allow for this annoying zooming with the zoom rectangle on mouseout.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1474 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-09-15 19:07:57 +00:00
parent 42db224f3d
commit c38874b374

View File

@@ -143,7 +143,10 @@ OpenLayers.Control.MouseDefaults.prototype =
defaultMouseOut: function (evt) {
if (this.mouseDragStart != null
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
this.defaultMouseUp(evt);
if (this.zoomBox) {
this.removeZoomBox();
}
this.mouseDragStart = null;
}
},
@@ -188,9 +191,16 @@ OpenLayers.Control.MouseDefaults.prototype =
(end.lat)
), this.map.getZoom() + 1);
}
this.removeZoomBox();
}
},
/**
* Remove the zoombox from the screen and nullify our reference to it.
*/
removeZoomBox: function() {
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox = null;
}
},