From e643531a0a4fb84d4eccd4b54f8ebea5f303355c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Wed, 30 Jun 2010 09:06:27 +0000 Subject: [PATCH] fix OverviewMap regression. r=elemoine (closes #2137) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10434 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler.js | 9 ++++++--- tests/Control/OverviewMap.html | 32 +++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Handler.js b/lib/OpenLayers/Handler.js index b4e623be51..26a631d293 100644 --- a/lib/OpenLayers/Handler.js +++ b/lib/OpenLayers/Handler.js @@ -91,7 +91,8 @@ OpenLayers.Handler = OpenLayers.Class({ * Parameters: * control - {} The control that initialized this * handler. The control is assumed to have a valid map property; that - * map is used in the handler's own setMap method. + * map is used in the handler's own setMap method. If a map property + * is present in the options argument it will be used instead. * callbacks - {Object} An object whose properties correspond to abstracted * events or sequences of browser events. The values for these * properties are functions defined by the control that get called by @@ -103,8 +104,10 @@ OpenLayers.Handler = OpenLayers.Class({ OpenLayers.Util.extend(this, options); this.control = control; this.callbacks = callbacks; - if (control.map) { - this.setMap(control.map); + + var map = this.map || control.map; + if (map) { + this.setMap(map); } this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); diff --git a/tests/Control/OverviewMap.html b/tests/Control/OverviewMap.html index 49f82dda93..e216e79ee0 100644 --- a/tests/Control/OverviewMap.html +++ b/tests/Control/OverviewMap.html @@ -2,7 +2,7 @@