From 4847d66d6a89cdc55b1f9b8aa27f305718714f10 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 19 Aug 2006 15:57:14 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Control/MouseToolbar.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/OpenLayers/Control/MouseToolbar.js b/lib/OpenLayers/Control/MouseToolbar.js index 5ba56f85de..6891d5502e 100644 --- a/lib/OpenLayers/Control/MouseToolbar.js +++ b/lib/OpenLayers/Control/MouseToolbar.js @@ -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; + } } });