Post-drag 'click' events aren't really clicks. Don't let them fall through to

the map.


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1316 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-08-19 15:57:14 +00:00
parent c4541115f9
commit 4847d66d6a

View File

@@ -35,6 +35,7 @@ OpenLayers.Control.MouseToolbar.prototype =
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
this.buttons = new Object();
this.map.events.register( "click", this, this.defaultClick );
this.map.events.register( "dblclick", this, this.defaultDblClick );
this.map.events.register( "mousedown", this, this.defaultMouseDown );
this.map.events.register( "mouseup", this, this.defaultMouseUp );
@@ -145,6 +146,7 @@ OpenLayers.Control.MouseToolbar.prototype =
"absolute");
this.measureBox.style.width="4px";
this.measureBox.style.height="4px";
this.measureBox.style.fontSize = "1px";
this.measureBox.style.backgroundColor="red";
this.measureBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.layerContainerDiv.appendChild(this.measureBox);
@@ -267,6 +269,12 @@ OpenLayers.Control.MouseToolbar.prototype =
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
this.defaultMouseUp(evt);
}
},
defaultClick: function (evt) {
if (this.performedDrag) {
this.performedDrag = false;
return false;
}
}
});