Skip to content

Conversation

@soosoo22
Copy link
Member

🔥 PR Title

calculate boundary, center coordinates and show current location

📌 Work Description

boundary

  • get boundary and center coordinates
  • send these coordinates to the api

location

  • get my current location using the geolocation api
  • show my current location on the map

✅ Checklist

  • Tested that the code works correctly
  • Updated documentation if necessary
  • Added explanations to help reviewers understand the code

📸 Screenshots (Optional)

🚀 How to Test (Optional)

💡 Notes / Discussion Points (Optional)

currently, real time location is requested through the browser popup.

@soosoo22 soosoo22 added this to the 2차 스프린트 milestone Oct 24, 2025
@soosoo22 soosoo22 self-assigned this Oct 24, 2025
@soosoo22 soosoo22 linked an issue Oct 24, 2025 that may be closed by this pull request
3 tasks
@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gryffindor Ready Ready Preview Comment Oct 25, 2025 1:59am

Copy link
Collaborator

@Salvation-sub Salvation-sub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +21 to +35
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} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

page layer가 더 깔끔해진것 같아서 좋구만유!

Copy link
Contributor

@haejinyun haejinyun left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요곤 추후 유저 값으로 수정일까용?

Copy link
Member Author

@soosoo22 soosoo22 Oct 25, 2025

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아무래도 저희 서비스가 위치나 위경도 값을 많이 다루다 보니까 해당 값들은 상수화나 중앙에서 가져올 수 있게 해보는 방식도 좋을 것 같아요!

메인 페이지 쪽에서도 위경도 값을 쓰고 있어서 혹시 나중에 유지보수 단계에서 혹여 혹시 값을 미처 못바꾼다던가.. 그런 상황을 막을 수 있을 것 같심다!

Copy link
Member Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!navigator.geolocation) {
setErrorMessage("");
if (!navigator.geolocation) {

requestLocation 호출 전에 errorMessage를 초기화해주는 로직을 추가하는 건 어떨까요?! 지금 로직상으로는 괜찮은데 혹시나 나중에 로딩 상태나 문구를 표시할 때, 이전 에러 메시지가 남아있을 것 같아서 여쭤봅니다

Copy link
Member Author

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추후에 절대경로/상대경로 섞여있는 걸 절대경로로 다 바꾸면 좋을 것 같습니다!

Copy link
Contributor

@javadocq javadocq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생많으셨습니다!!!

@soosoo22 soosoo22 merged commit 8bedcf0 into main Oct 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: calculate map viewport bounds

5 participants