-
Notifications
You must be signed in to change notification settings - Fork 0
feat: calculate boundary, center coordinates and show current location #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Salvation-sub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| const { map, mapContainerRef, initializeMap } = useMapInitialize(); | ||
| const { bounds, center, updateCoordinate } = useMapCoordinate(); | ||
| const { requestLocation } = useLocation(map); | ||
|
|
||
| const { storeList, refetch, isFetching } = useStoreListQuery(filters); | ||
| const { isFilterOpen, filters, openFilter, closeFilter, applyFilters } = useMapFilters(); | ||
| const { storeList, isFetching } = useStoreListQuery(filters, { bounds, center }); | ||
|
|
||
| return ( | ||
| <TransitionLayout> | ||
| <MapView storeList={storeList} /> | ||
| <FetchStoreListButton onClick={refetch} isFetching={isFetching} /> | ||
| <MapActionButton type="filter" onClick={() => setIsFilterOpen(true)} /> | ||
| <MapActionButton type="location" onClick={() => {}} /> | ||
| <MapView mapRef={mapContainerRef} initializeMap={initializeMap} /> | ||
| <MapMarkers map={map} storeList={storeList} /> | ||
|
|
||
| <FetchStoreListButton onClick={() => updateCoordinate(map)} isFetching={isFetching} /> | ||
| <MapActionButton type="filter" onClick={openFilter} /> | ||
| <MapActionButton type="location" onClick={requestLocation} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
page layer가 더 깔끔해진것 같아서 좋구만유!
haejinyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
메인 쪽 페이지랑 값이 겹치거나 중앙화 했을 때 좋아보인다고 느끼는 부분을 적어보았습니다!(유저 정보, 위경도 값)
바로 수정이 필요한 부분이라기 보다는 어떻게 처리할 것인지 이야기 나누고 진행 하면 좋을 것 같습니다!
| const [isFilterOpen, setIsFilterOpen] = useState(false); | ||
| const [filters, setFilters] = useState<FilterData>({ | ||
| price: { min: 0, max: 20000 }, | ||
| honbobLevel: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요곤 추후 유저 값으로 수정일까용?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정했습니당!! 8bfd473
|
|
||
| const mapInstance = new window.naver.maps.Map(mapContainerRef.current, { | ||
| // 초기 위치 강남역 | ||
| center: new window.naver.maps.LatLng(37.497175, 127.027926), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아무래도 저희 서비스가 위치나 위경도 값을 많이 다루다 보니까 해당 값들은 상수화나 중앙에서 가져올 수 있게 해보는 방식도 좋을 것 같아요!
메인 페이지 쪽에서도 위경도 값을 쓰고 있어서 혹시 나중에 유지보수 단계에서 혹여 혹시 값을 미처 못바꾼다던가.. 그런 상황을 막을 수 있을 것 같심다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 좋은 것 같습니다!
| }; | ||
|
|
||
| const requestLocation = () => { | ||
| if (!navigator.geolocation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!navigator.geolocation) { | |
| setErrorMessage(""); | |
| if (!navigator.geolocation) { |
requestLocation 호출 전에 errorMessage를 초기화해주는 로직을 추가하는 건 어떨까요?! 지금 로직상으로는 괜찮은데 혹시나 나중에 로딩 상태나 문구를 표시할 때, 이전 에러 메시지가 남아있을 것 같아서 여쭤봅니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정했습니당! e57f873
| import { useCallback, useEffect } from "react"; | ||
| import { getDefaultStationCenter } from "@/entities/storeList/lib"; | ||
| import { useLocationStore } from "@/shared/store"; | ||
| import { useGeolocation } from "./useGeolocation"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후에 절대경로/상대경로 섞여있는 걸 절대경로로 다 바꾸면 좋을 것 같습니다!
javadocq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생많으셨습니다!!!
🔥 PR Title
calculate boundary, center coordinates and show current location
📌 Work Description
boundary
location
✅ Checklist
📸 Screenshots (Optional)
🚀 How to Test (Optional)
💡 Notes / Discussion Points (Optional)
currently, real time location is requested through the browser popup.