Use overlay container instead of viewport for ol.render.Box

This commit is contained in:
Andreas Hocevar
2015-10-15 20:22:14 +02:00
parent fcdff1c841
commit 2d50511527
2 changed files with 6 additions and 3 deletions

View File

@@ -82,13 +82,13 @@ ol.render.Box.prototype.render_ = function() {
*/
ol.render.Box.prototype.setMap = function(map) {
if (this.map_) {
this.map_.getViewport().removeChild(this.element_);
this.map_.getOverlayContainer().removeChild(this.element_);
var style = this.element_.style;
style.left = style.top = style.width = style.height = 'inherit';
}
this.map_ = map;
if (this.map_) {
this.map_.getViewport().appendChild(this.element_);
this.map_.getOverlayContainer().appendChild(this.element_);
}
};