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:
@@ -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,11 +191,18 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
(end.lat)
|
||||
), this.map.getZoom() + 1);
|
||||
}
|
||||
this.map.viewPortDiv.removeChild(this.zoomBox);
|
||||
this.zoomBox = null;
|
||||
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;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Mouse ScrollWheel code thanks to http://adomas.org/javascript-mouse-wheel/
|
||||
|
||||
Reference in New Issue
Block a user