Add new container which don't stop event propagation

and allow overlays to optionnally stop event propagation
This commit is contained in:
Bruno Binet
2013-10-11 11:12:36 +02:00
parent 8c8dbe2ece
commit caf958826d
2 changed files with 32 additions and 6 deletions

View File

@@ -60,6 +60,12 @@ ol.Overlay = function(options) {
goog.base(this);
/**
* @private
* @type {boolean}
*/
this.stopEvent_ = goog.isDef(options.stopEvent) ? options.stopEvent : false;
/**
* @private
* @type {Element}
@@ -202,8 +208,10 @@ ol.Overlay.prototype.handleMapChanged = function() {
this.mapPostrenderListenerKey_ = goog.events.listen(map,
ol.MapEventType.POSTRENDER, this.handleMapPostrender, false, this);
this.updatePixelPosition_();
goog.dom.append(
/** @type {!Node} */ (map.getOverlayContainer()), this.element_);
goog.dom.append(/** @type {!Node} */ (
this.stopEvent_ ? map.getOverlayContainerStopEvent() :
map.getOverlayContainer()),
this.element_);
}
};