Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김재현
/
open-source-project-2017-02
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김정은
2017-12-07 14:04:44 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
450811873ca3d15bef6ea365fd54ebf50523f2c4
45081187
2 parents
ba46b7f6
a85f86af
Merge branch 'master' of
http://khuhub.khu.ac.kr/2013104063/open-source-project-2017-02
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
30 deletions
routes/index.js
views/map.ejs
routes/index.js
View file @
4508118
...
...
@@ -4,8 +4,8 @@ var router = express.Router();
var
connection
=
mysql
.
createConnection
({
host
:
'localhost'
,
user
:
'
root
'
,
password
:
'
qmfkdnsl
'
,
user
:
'
admin
'
,
password
:
'
admin
'
,
database
:
'ossprojectdb'
});
...
...
views/map.ejs
View file @
4508118
...
...
@@ -6,22 +6,18 @@
<script
async
defer
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyBTR69UvS1403rvBcM64_8nlzpKLv23RIE&libraries=places"
></script>
<script>
//표시하기 버튼 눌렀을 때 post보내는 함수
function
forming
()
{
if
(
confirm
(
"맛집견문록에 기록하겠습니까?"
)){
document
.
forms
[
"userform"
].
submit
();
return
true
;
}
else
{
return
false
;
}
function
addShop
(
id
)
{
var
placeid
=
$
(
id
).
attr
(
'id'
);
var
placename
=
$
(
id
).
attr
(
'name'
);
var
placeaddress
=
$
(
id
).
attr
(
'address'
);
$
(
'input[name=id]'
).
val
(
placeid
);
$
(
'input[name=title]'
).
val
(
placename
);
$
(
'input[name=address]'
).
val
(
placeaddress
);
$
(
'form[name=submit]'
).
submit
();
}
function
initMap
(
latitude
,
longitude
)
{
var
center
=
{
lat
:
latitude
,
lng
:
longitude
};
map
=
new
google
.
maps
.
Map
(
document
.
getElementById
(
'map'
),
{
...
...
@@ -74,7 +70,7 @@
'<h1 id="firstHeading" class="firstHeading">'
+
place
.
name
+
'</h1>'
+
'<div id="bodyContent">'
+
'<p>주소: '
+
place
.
vicinity
+
'<br/>'
+
'<
a href="#" onclick="forming();
">'
+
'<
button id="'
+
place
.
id
+
'" name="'
+
place
.
name
+
'" address="'
+
place
.
vicinity
+
'" onclick="addShop(this)
">'
+
'표시하기</a> '
+
'</p>'
+
'</div>'
+
...
...
@@ -82,27 +78,13 @@
google
.
maps
.
event
.
addListener
(
marker1
,
'click'
,
function
(
e
)
{
//console.log(place)
var
infowindow
=
new
google
.
maps
.
InfoWindow
({
content
:
contentString
,
maxWidth
:
300
});
infowindow
.
open
(
map
,
this
);
//marker1.setMap(null);
//marker2.setMap(map);
console
.
log
(
'<%=user.username%>'
);
// console.log(document.getElementsByName('placeaddress').value);
});
google
.
maps
.
event
.
addListener
(
marker2
,
'click'
,
function
()
{
...
...
@@ -175,7 +157,11 @@
</div>
<div
id =
"footer"
></div>
<form
name=
"shop"
method=
"post"
action=
"/shop"
>
<input
type=
"hidden"
name=
"id"
/>
<input
type=
"hidden"
name=
"title"
/>
<input
type=
"hidden"
name=
"address"
/>
</form>
</body>
</html>
...
...
Please
register
or
login
to post a comment