mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00
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:
@ -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'});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user