Fix Popup keepInView if the map needs to panned over a long distance (#7792)

* Fix keepInView recursion #5035

* Fix test

Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
This commit is contained in:
Falke Design
2021-11-25 19:34:19 +01:00
committed by GitHub
parent 1180e7e8c2
commit 4dadf840af
2 changed files with 6 additions and 7 deletions

View File

@ -235,7 +235,7 @@ export var Popup = DivOverlay.extend({
DomUtil.setPosition(this._container, pos.add(anchor));
},
_adjustPan: function () {
_adjustPan: function (e) {
if (!this.options.autoPan) { return; }
if (this._map._panAnim) { this._map._panAnim.stop(); }
@ -275,7 +275,7 @@ export var Popup = DivOverlay.extend({
if (dx || dy) {
map
.fire('autopanstart')
.panBy([dx, dy]);
.panBy([dx, dy], {animate: e && e.type === 'moveend'});
}
},