feat(viewport-helpers): return promises

This commit is contained in:
moklick
2024-07-08 13:18:07 +02:00
parent e1d023641b
commit 2503d32a88
15 changed files with 140 additions and 87 deletions
+3 -3
View File
@@ -287,15 +287,15 @@ const createStore = ({
nodeExtent,
});
},
panBy: (delta): boolean => {
panBy: (delta): Promise<boolean> => {
const { transform, width, height, panZoom, translateExtent } = get();
return panBySystem({ delta, panZoom, transform, translateExtent, width, height });
},
fitView: (options?: FitViewOptions): boolean => {
fitView: (options?: FitViewOptions): Promise<boolean> => {
const { panZoom, width, height, minZoom, maxZoom, nodeLookup } = get();
if (!panZoom) {
return false;
return Promise.resolve(false);
}
return fitViewSystem(