Overlay visible before updating render position

Make the overlay visible before updating the render position
so that the `offsetWidth` and `offsetHeight` can be 
considered in evaluating the offset and positioning of the 
element

See openlayers/openlayers#6566
This commit is contained in:
Jonathan Nagy
2017-03-08 15:53:42 +11:00
committed by GitHub
parent 49af45c8b7
commit c54bf85dfc

View File

@@ -464,6 +464,8 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
var positioning = this.getPositioning();
this.setVisible(true);
var offsetX = offset[0];
var offsetY = offset[1];
if (positioning == ol.OverlayPositioning.BOTTOM_RIGHT ||
@@ -514,8 +516,6 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
this.rendered_.top_ = style.top = top;
}
}
this.setVisible(true);
};