Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오지민
/
HomePurchaseAgePrediction
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
Ojimin
2021-06-09 22:14:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5af714bc0f2b428bf06217fafea3af1aa4f4842f
5af714bc
1 parent
f8b12c46
Get location from user
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletions
main.html
public/js/next_page.js
server.js
main.html
View file @
5af714b
...
...
@@ -39,6 +39,15 @@
/>
</div>
<div>
거주지역
<input
type=
"text"
id=
"address"
name=
"address"
placeholder=
"(도/시/구/동)을 입력해주세요."
/>
</div>
<div>
<input
class=
"btn"
type=
"submit"
value=
"SUBMIT"
/>
</div>
</form>
...
...
public/js/next_page.js
View file @
5af714b
...
...
@@ -74,6 +74,18 @@ function makeOutListener(infowindow) {
}
*/
searchAddrFromCoords
(
map
.
getCenter
(),
displayCenterInfo
);
function
searchAddrFromCoords
(
coords
,
callback
)
{
// 좌표로 행정동 주소 정보를 요청합니다
geocoder
.
coord2RegionCode
(
coords
.
getLng
(),
coords
.
getLat
(),
callback
);
}
function
displayCenterInfo
(
result
,
status
)
{
if
(
status
===
kakao
.
maps
.
services
.
Status
.
OK
)
{
var
infoDiv
=
document
.
getElementById
(
'you'
);
infoDiv
.
innerHTML
=
result
[
0
].
address_name
;
}
}
function
displayMarker
(
Position
)
{
var
marker
=
new
kakao
.
maps
.
Marker
({
map
:
map
,
...
...
server.js
View file @
5af714b
...
...
@@ -4,6 +4,8 @@ const path = require("path");
const
HTTPS
=
require
(
"https"
);
const
mysql
=
require
(
'mysql'
);
var
address
;
const
app
=
express
();
const
domain
=
"2020105635.oss2021.tk"
;
const
sslport
=
8080
;
...
...
@@ -21,7 +23,7 @@ db.query('SELECT * FROM csvdata.csvdata', function (error, results, fields) {
if
(
error
)
{
throw
(
error
);
}
console
.
log
(
results
[
0
].
amount
);
console
.
log
(
results
.
length
);
});
app
.
get
(
"/"
,
function
(
req
,
res
)
{
...
...
@@ -29,6 +31,8 @@ app.get("/", function (req, res) {
});
app
.
get
(
"/geolocation"
,
function
(
req
,
res
)
{
address
=
req
.
query
.
address
;
console
.
log
(
address
);
res
.
sendFile
(
path
.
join
(
__dirname
+
"/kakao/kakaomap.html"
));
});
...
...
Please
register
or
login
to post a comment