Skip to content

Commit

Permalink
[#7] feat : restaurant map
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongBin0227 committed Feb 21, 2021
1 parent 0b79ab7 commit 263f375
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/components/Restaurent/RestarentMap/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*global kakao */
import React, { useEffect } from 'react'

declare global {
interface Window {
kakao: any
}
}

export const RestaurantMap: React.FC = () => {
useEffect(() => {
RestaurantKakaoMap()
}, [])

const RestaurantKakaoMap = () => {
let container = document.getElementById('map')
let options = {
center: new window.kakao.maps.LatLng(
37.624915253753194,
127.15122688059974
),
level: 5,
}
//map
const map = new window.kakao.maps.Map(container, options)

//마커가 표시 될 위치
let markerPosition = new window.kakao.maps.LatLng(
37.62197524055062,
127.16017523675508
)

// 마커를 생성
let marker = new window.kakao.maps.Marker({
position: markerPosition,
})

// 마커를 지도 위에 표시
marker.setMap(map)
}

return <div id="map" style={{ width: '100vw', height: '100vh' }}></div>
}
Empty file.
17 changes: 17 additions & 0 deletions src/components/Restaurent/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@use '@/style/package' as *;

.restaurent {
position: absolute;
right: 2rem;
top: 5rem;
background-color: rgba($color-black, 0.5);
padding: 16px;
width: 80rem;
height: 30rem;
border-radius: 0.8rem;
overflow-y: scroll;

&::-webkit-scrollbar {
display: none;
}
}

0 comments on commit 263f375

Please sign in to comment.