ol.Popup no longer relies on map.getEvents

This commit is contained in:
Éric Lemoine
2012-07-09 09:30:34 +02:00
parent 9e693f29c5
commit e0b53360d2

View File

@@ -208,7 +208,8 @@ ol.Popup.prototype.doOpen = function(opt_arg) {
goog.dom.appendChild(this.container_, closeButton);
goog.dom.classes.add(closeButton, ol.Popup.CLASS_NAME+'-close');
}
this.map_.getEvents().register('click', this.clickHandler, this);
goog.events.listen(this.map_.getViewport(), 'click', this.clickHandler,
undefined, this);
goog.dom.appendChild(this.map_.getMapOverlay(), this.container_);
}