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 062a78f commit 3d257c2
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/place/placesearch/BottomSheet/BottomSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@ const BottomSheet = ({

const handleLocationClick = () => {
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 () => {
console.log("Selected Sido:", selectedSido);
console.log("Selected Gungu:", selectedGungu);

if (useCurrentLocation) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
Expand Down

0 comments on commit 3d257c2

Please sign in to comment.