fix OverviewMap regression. r=elemoine (closes #2137)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10434 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2010-06-30 09:06:27 +00:00
parent 0bc3e3c8b3
commit e643531a0a
2 changed files with 37 additions and 4 deletions

View File

@@ -91,7 +91,8 @@ OpenLayers.Handler = OpenLayers.Class({
* Parameters:
* control - {<OpenLayers.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 + "_");