mirror of
https://github.com/visgl/react-map-gl.git
synced 2025-12-08 20:16:02 +00:00
wrap jumpTo as internal update (#2516)
This commit is contained in:
parent
129848b624
commit
607d5dc6df
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user