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:
+2
-2
@@ -464,6 +464,8 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
|
|
||||||
var positioning = this.getPositioning();
|
var positioning = this.getPositioning();
|
||||||
|
|
||||||
|
this.setVisible(true);
|
||||||
|
|
||||||
var offsetX = offset[0];
|
var offsetX = offset[0];
|
||||||
var offsetY = offset[1];
|
var offsetY = offset[1];
|
||||||
if (positioning == ol.OverlayPositioning.BOTTOM_RIGHT ||
|
if (positioning == ol.OverlayPositioning.BOTTOM_RIGHT ||
|
||||||
@@ -514,8 +516,6 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
this.rendered_.top_ = style.top = top;
|
this.rendered_.top_ = style.top = top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setVisible(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user