Skip to content

Commit

Permalink
feat(#75) : 내 주변 클릭, 검색 시 초기화
Browse files Browse the repository at this point in the history
  • Loading branch information
KangBoSeok-kor committed Dec 11, 2024
1 parent 91f9e06 commit 2e5fdc7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/place/placemap/BottomSheet/BottomSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,21 @@ const BottomSheet = ({
setInputValue("");;
};

const handleLocationClick = () => {
const handleLocationClick = async () => {
setUseCurrentLocation(true);

if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
(position) => {
const { latitude, longitude } = position.coords;
router.push(`/place/placemap?lat=${latitude}&lng=${longitude}`);
},
() => alert("현재 위치를 가져올 수 없습니다.")
);
} else {
alert("브라우저가 현재 위치 기능을 지원하지 않습니다.");
}
handleReset();
};

const handleSearch = async () => {
Expand Down Expand Up @@ -101,6 +114,7 @@ const BottomSheet = ({
} else {
alert("지역 또는 사업장명을 입력하거나 시/도를 선택해주세요.");
}
handleReset();
};


Expand Down

0 comments on commit 2e5fdc7

Please sign in to comment.