From c54bf85dfc40d2af120d4b42c552609578677f1c Mon Sep 17 00:00:00 2001 From: Jonathan Nagy Date: Wed, 8 Mar 2017 15:53:42 +1100 Subject: [PATCH 1/2] 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 --- src/ol/overlay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 9e80c14ad4..757686d29e 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -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); }; From 915b83a0682b073aa65141dbe1f9936b78ea6154 Mon Sep 17 00:00:00 2001 From: Jonathan Nagy Date: Wed, 8 Mar 2017 16:34:27 +1100 Subject: [PATCH 2/2] Remove trailing whitespace. --- src/ol/overlay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 757686d29e..4be6ff6e3e 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -465,7 +465,7 @@ 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 ||