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
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김시환
2022-11-21 19:14:44 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
b555c5f3b187701b45d1692cf3d81ac2ca0cdef8
b555c5f3
2 parents
d9088285
2d0b93bc
Merge branch 'main' into 'main'
move selectAddress See merge request !5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
Address.js
Address.js
View file @
b555c5f
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
})
}
function
selectAddress
(
addressArray
,
number
)
{
/*
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