prevent overview map extent rectangle from getting dropped (FF only) - see #468

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2166 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-01-20 16:49:52 +00:00
parent f30d0e40c2
commit 7518b9716c
2 changed files with 13 additions and 11 deletions

View File

@@ -133,7 +133,6 @@ OpenLayers.Control.OverviewMap.prototype =
OpenLayers.Event.stop(e); OpenLayers.Event.stop(e);
}); });
this.rectEvents = new OpenLayers.Events(this, this.extentRectangle); 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('mouseout', this, this.rectMouseOut);
this.rectEvents.register('mousedown', this, this.rectMouseDown); this.rectEvents.register('mousedown', this, this.rectMouseDown);
this.rectEvents.register('mousemove', this, this.rectMouseMove); this.rectEvents.register('mousemove', this, this.rectMouseMove);
@@ -197,21 +196,23 @@ OpenLayers.Control.OverviewMap.prototype =
this.map.events.unregister("changebaselayer", this, this.baseLayerDraw); this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
}, },
/**
* @param {OpenLayers.Event} evt
*/
rectMouseOver: function (evt) {
this.extentRectangle.style.cursor = 'move';
},
/** /**
* @param {OpenLayers.Event} evt * @param {OpenLayers.Event} evt
*/ */
rectMouseOut: function (evt) { rectMouseOut: function (evt) {
this.extentRectangle.style.cursor = 'default';
if(this.rectDragStart != null) { if(this.rectDragStart != null) {
if(this.performedRectDrag) { if(this.performedRectDrag) {
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(); this.updateMapToRect();
} else {
return;
}
} }
document.onselectstart = null; document.onselectstart = null;
this.rectDragStart = null; this.rectDragStart = null;

View File

@@ -56,6 +56,7 @@ div.olControlMousePosition {
} }
.olControlOverviewMapExtentRectangle { .olControlOverviewMapExtentRectangle {
cursor: move;
border: 2px dotted red; border: 2px dotted red;
} }
.olLayerGeoRSSDescription { .olLayerGeoRSSDescription {