wrap jumpTo as internal update (#2516)

This commit is contained in:
Xiaoji Chen 2025-04-08 09:10:48 -07:00 committed by GitHub
parent 129848b624
commit 607d5dc6df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -340,6 +340,15 @@ export default class Mapbox {
this._proxyTransform.$internalUpdate = false;
this._fireDefferedEvents();
};
// eslint-disable-next-line @typescript-eslint/unbound-method
const jumpTo = map.jumpTo;
map.jumpTo = (...args: Parameters<MapInstance['jumpTo']>) => {
// This method will fire view state change events immediately
this._proxyTransform.$internalUpdate = true;
jumpTo.apply(map, args);
this._proxyTransform.$internalUpdate = false;
return map;
};
// Insert code into map's event pipeline
// eslint-disable-next-line @typescript-eslint/unbound-method
const fireEvent = map.fire;