diff --git a/lib/OpenLayers/Control/OverviewMap.js b/lib/OpenLayers/Control/OverviewMap.js index 7d134978e2..be413614e0 100644 --- a/lib/OpenLayers/Control/OverviewMap.js +++ b/lib/OpenLayers/Control/OverviewMap.js @@ -133,7 +133,6 @@ OpenLayers.Control.OverviewMap.prototype = OpenLayers.Event.stop(e); }); this.rectEvents = new OpenLayers.Events(this, this.extentRectangle); - this.rectEvents.register('mouseover', this, this.rectMouseOver); this.rectEvents.register('mouseout', this, this.rectMouseOut); this.rectEvents.register('mousedown', this, this.rectMouseDown); this.rectEvents.register('mousemove', this, this.rectMouseMove); @@ -197,22 +196,24 @@ OpenLayers.Control.OverviewMap.prototype = this.map.events.unregister("changebaselayer", this, this.baseLayerDraw); }, - /** - * @param {OpenLayers.Event} evt - */ - rectMouseOver: function (evt) { - this.extentRectangle.style.cursor = 'move'; - }, - /** * @param {OpenLayers.Event} evt */ rectMouseOut: function (evt) { - this.extentRectangle.style.cursor = 'default'; if(this.rectDragStart != null) { if(this.performedRectDrag) { - this.updateMapToRect(); - } + this.rectMouseMove(evt); + var rectPxBounds = this.getRectPxBounds(); + // if we're off of the overview map, update the main map + // otherwise, keep moving the rect + if((rectPxBounds.top <= 0) || (rectPxBounds.left <= 0) || + (rectPxBounds.bottom >= this.size.h - this.hComp) || + (rectPxBounds.right >= this.size.w - this.wComp)) { + this.updateMapToRect(); + } else { + return; + } + } document.onselectstart = null; this.rectDragStart = null; } diff --git a/theme/default/style.css b/theme/default/style.css index 89deaa2cde..61663ba9d0 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -56,6 +56,7 @@ div.olControlMousePosition { } .olControlOverviewMapExtentRectangle { + cursor: move; border: 2px dotted red; } .olLayerGeoRSSDescription {