Skip to content

Commit

Permalink
Bug fix on incorrect zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Oct 29, 2024
1 parent 78633dd commit 13d55ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/components/map/mapbox/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ const ReactMap = ({
);
resizeObserver.observe(map.getContainer());

if (import.meta.env.MODE === "dev") {
//map.showPadding = true;
//map.showCollisionBoxes = true;
}

return () => {
resizeObserver.unobserve(map.getContainer());
map.off("zoomend", debounceOnZoomEvent);
Expand Down
14 changes: 12 additions & 2 deletions src/pages/search-page/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,20 @@ const SearchPage = () => {
);
setZoom(componentParam.zoom);

doMapSearch();
startOneLoadingThread();
doMapSearch().finally(() => {
endOneLoadingThread();
});
}
}
}, [location, dispatch, doSearch, doMapSearch]);
}, [
location,
dispatch,
doSearch,
doMapSearch,
startOneLoadingThread,
endOneLoadingThread,
]);

const onChangeSorting = useCallback(
(v: SortResultEnum) => {
Expand Down

0 comments on commit 13d55ce

Please sign in to comment.