Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정성훈
/
MEALKHU
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
swa07016
2020-06-03 15:59:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
31494f49253089fa1ccf39f61c164d746d1818cd
31494f49
1 parent
e5ea5134
kakao map api 이용 Map 컴포넌트 구현
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
6 deletions
.gitignore
client/public/index.html
client/src/components/Map.js
client/src/components/MealCard.js
client/src/pages/MenuPage.js
.gitignore
View file @
31494f4
node_modules
json_datas.json
client/public/images
client/node_modules
\ No newline at end of file
client/node_modules
client/src/config
\ No newline at end of file
...
...
client/public/index.html
View file @
31494f4
...
...
@@ -36,7 +36,6 @@ height: 100%;
<body
class=
"pt-5"
style=
"width : 100%; height:100%; margin: 0;"
>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
style=
"width : 100%; height:100%;"
></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
...
...
client/src/components/Map.js
0 → 100644
View file @
31494f4
/*global kakao*/
import
React
,
{
useEffect
}
from
'react'
import
appKey
from
'../config/appKey.json'
;
const
Map
=
(
props
)
=>
{
useEffect
(()
=>
{
const
script
=
document
.
createElement
(
"script"
);
script
.
async
=
true
;
script
.
src
=
`https://dapi.kakao.com/v2/maps/sdk.js?appkey=
${
appKey
.
value
}
&autoload=false`
;
document
.
head
.
appendChild
(
script
);
script
.
onload
=
()
=>
{
kakao
.
maps
.
load
(()
=>
{
let
container
=
document
.
getElementById
(
"myMap"
);
let
options
=
{
center
:
new
kakao
.
maps
.
LatLng
(
props
.
latitude
,
props
.
longitude
),
level
:
3
};
const
map
=
new
window
.
kakao
.
maps
.
Map
(
container
,
options
);
let
markerPosition
=
new
kakao
.
maps
.
LatLng
(
props
.
latitude
,
props
.
longitude
);
let
marker
=
new
kakao
.
maps
.
Marker
({
position
:
markerPosition
});
marker
.
setMap
(
map
);
});
};
}
);
return
(
<
div
id
=
'myMap'
style
=
{{
'width'
:
'100%'
,
'height'
:
'25rem'
}}
><
/div
>
)
}
export
default
Map
;
\ No newline at end of file
client/src/components/MealCard.js
View file @
31494f4
import
React
,
{
useState
}
from
'react'
;
import
{
Card
,
CardBody
,
CardTitle
,
CardText
,
CardImg
,
CardFooter
,
Button
}
from
'reactstrap'
;
import
{
Modal
,
ModalHeader
,
ModalBody
,
ModalFooter
,
Container
}
from
'reactstrap'
;
import
Map
from
'./Map'
;
import
'./MealCard.css'
;
import
{
faAngleRight
}
from
"@fortawesome/free-solid-svg-icons"
import
{
FontAwesomeIcon
}
from
"@fortawesome/react-fontawesome"
const
MealCard
=
(
props
)
=>
{
const
[
modal
,
setModal
]
=
useState
(
false
);
const
toggleModal
=
()
=>
setModal
(
!
modal
);
return
(
...
...
@@ -66,9 +67,12 @@ const MealCard = (props) => {
<
hr
className
=
"my-2"
/>
{
props
.
address
}
<
br
/>
<
Map
latitude
=
{
props
.
latitude
}
longitude
=
{
props
.
longitude
}
/
>
Lorem
ipsum
dolor
sit
amet
,
consectetur
adipisicing
elit
,
sed
do
eiusmod
tempor
incididunt
ut
labore
et
dolore
magna
aliqua
.
Ut
enim
ad
minim
veniam
,
quis
nostrud
exercitation
ullamco
laboris
nisi
ut
aliquip
ex
ea
commodo
consequat
.
Duis
aute
irure
dolor
in
reprehenderit
in
voluptate
velit
esse
cillum
dolore
eu
fugiat
nulla
pariatur
.
Excepteur
sint
occaecat
cupidatat
non
proident
,
sunt
in
culpa
qui
officia
deserunt
mollit
anim
id
est
laborum
.
<
/ModalBody
>
<
ModalFooter
>
<
div
style
=
{{
...
...
client/src/pages/MenuPage.js
View file @
31494f4
...
...
@@ -51,7 +51,6 @@ const MenuPage = (props) => {
for
(
let
k
=
0
;
k
<
temp
.
length
;
k
++
)
{
if
(
datas
[
j
].
type
===
temp
[
k
])
{
result
.
push
(
datas
[
j
]);
console
.
log
(
'skr'
);
}
}
}
...
...
Please
register
or
login
to post a comment