From 803e8b9dbd1ca7240ebdc79297718ce3b59e7396 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 22 Mar 2007 21:06:29 +0000 Subject: [PATCH] fix for #457 - allow specification of whether or not to let events fallthrough the map git-svn-id: http://svn.openlayers.org/trunk/openlayers@2863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 1005cbba89..988ca2c50c 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -127,6 +127,15 @@ OpenLayers.Map.prototype = { /** @type string */ theme: null, + /** Should OpenLayers allow events on the map to fall through to other + * elements on the page, or should it swallow them? (#457) + * + * Default is to swallow them. + * + * @type boolean + */ + fallThrough: false, + /** * @constructor * @@ -134,6 +143,9 @@ OpenLayers.Map.prototype = { * @param {Object} options Hashtable of extra options to tag onto the map */ initialize: function (div, options) { + + //set the default options + this.setOptions(options); this.div = div = OpenLayers.Util.getElement(div); @@ -154,7 +166,7 @@ OpenLayers.Map.prototype = { this.viewPortDiv.appendChild(this.layerContainerDiv); - this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES); + this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES, this.fallThrough); this.updateSize(); @@ -172,9 +184,6 @@ OpenLayers.Map.prototype = { this.updateSize.bindAsEventListener(this)); } - //set the default options - this.setOptions(options); - // only append link stylesheet if the theme property is set if(this.theme) { var cssNode = document.createElement('link');