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:00:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
66f47731d70cfecaf84815c046e76af67c15a410
66f47731
1 parent
8f05e00c
submit함수 구현
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
30 deletions
routes/index.js
views/map.ejs
routes/index.js
View file @
66f4773
...
...
@@ -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 @
66f4773
...
...
@@ -6,21 +6,17 @@
<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
};
...
...
@@ -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
()
{
...
...
Please
register
or
login
to post a comment