diff --git a/src/components/map/KakaoMap.tsx b/src/components/map/KakaoMap.tsx new file mode 100644 index 00000000..d9715549 --- /dev/null +++ b/src/components/map/KakaoMap.tsx @@ -0,0 +1,56 @@ +/* eslint-disable @next/next/no-before-interactive-script-outside-document */ + +'use client'; + +import { useState } from 'react'; +import { + Map, MapMarker, CustomOverlayMap, +} from 'react-kakao-maps-sdk'; + +import Script from 'next/script'; + +interface IMarkerPosition { + lat: number; + lng: number; +} + +const KAKAO_SDK_URL = `//dapi.kakao.com/v2/maps/sdk.js?appkey=${process.env.NEXT_PUBLIC_KAKAO_APP_JS_KEY}&autoload=false`; + +function KakaoMap() { + const [isOpen, setIsOpen] = useState(false); + const [clickedMarkerPosition, setClickedMarkerPosition] = useState({ lat: 0, lng: 0 }); + + const handleMarkerClick = (position:IMarkerPosition) => { + setClickedMarkerPosition(position); + setIsOpen(true); + }; + + // TODO: 주소를 받아서 좌표로 변환후 뿌려주기 + // TODO: CustomOverlayMap 컴포넌트 UI + + return ( + <> +