Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김시환
/
emergency_room_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
윤규리
2022-11-21 19:00:29 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2d0b93bccd69d35865ad415c9c0e2845aaa19e9d
2d0b93bc
1 parent
c5a6ad4e
move selectAddress
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
6 deletions
Address.js
Address.js
View file @
2d0b93b
import
fetch
from
"node-fetch"
;
globalThis
.
fetch
=
fetch
;
var
currAddress
=
new
Array
();
function
getAdddress
(
currQuery
)
{
var
AddressList
=
new
Array
();
function
getAddress
(
currQuery
)
{
fetch
(
'https://dapi.kakao.com/v2/local/search/address.json?'
+
new
URLSearchParams
({
query
:
currQuery
}),
{
...
...
@@ -11,17 +13,42 @@ function getAdddress(currQuery) {
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
currAddress
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
// console.log(currAddress)
return
currAddress
return
AddressList
})
}
/*
move to Line
var x; var y;
var regions = new Array();
// addressArray <- return value from function getAddress
function selectAddress(addressArray, number) {
x = addressArray[number].road_address.x
y = addressArray[number].road_address.y
regions.region_1depth_name = addressArray[number].road_address.region_1depth_name;
regions.region_2depth_name = addressArray[number].road_address.region_2depth_name;
regions.region_3depth_name = addressArray[number].road_address.region_3depth_name;
}
function
getXY
()
{
*/
// hospitals: array from hospital API
// addNum: index of addressArray
function
getXY
(
hospitals
,
addNum
)
{
AddressList
=
null
;
}
module
.
exports
=
{
getAddress
,
selectAddress
,
getXY
};
\ No newline at end of file
module
.
exports
=
{
getAddress
,
getXY
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment