diff --git a/src/ol/Overlay.js b/src/ol/Overlay.js index dff3e1fe25..7b82dfe5f4 100644 --- a/src/ol/Overlay.js +++ b/src/ol/Overlay.js @@ -328,9 +328,7 @@ class Overlay extends BaseObject { */ handlePositionChanged() { this.updatePixelPosition(); - if (this.get(Property.POSITION) && this.autoPan) { - this.performAutoPan(); - } + this.performAutoPan(); } /** @@ -403,7 +401,7 @@ class Overlay extends BaseObject { panIntoView(panIntoViewOptions) { const map = this.getMap(); - if (!map || !map.getTargetElement()) { + if (!map || !map.getTargetElement() || !this.get(Property.POSITION)) { return; }