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:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user