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
AzureAD\김대연
2022-11-29 16:34:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
beee194a7dd36461a2084423d5730c3c6ebddd1d
beee194a
1 parent
a771dbc6
address update
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
Address.js
Address.js
View file @
beee194
...
...
@@ -6,22 +6,30 @@ globalThis.fetch = fetch.fetch;
var
AddressList
=
new
Array
();
function
getAddress
(
currQuery
)
{
fetch
(
'https://dapi.kakao.com/v2/local/search/address.json?'
+
new
URLSearchParams
({
query
:
currQuery
}),
{
method
:
"GET"
,
headers
:
{
"Authorization"
:
"KakaoAK c14234ba46c574c73715276c5644f397"
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
console
.
log
(
response
)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
console
.
log
(
AddressList
)
return
AddressList
})
function
getAddress
(
currQuery
,
cb
=
()
=>
{})
{
setTimeout
(
function
()
{
fetch
(
'https://dapi.kakao.com/v2/local/search/address.json?'
+
new
URLSearchParams
({
query
:
currQuery
}),
{
method
:
"GET"
,
headers
:
{
"Authorization"
:
"KakaoAK c14234ba46c574c73715276c5644f397"
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
//console.log(response)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
//console.log(AddressList)
cb
(
AddressList
);
});
},
100
)
}
/*
getAddress('석수동길', function (address) {
console.log(address[0].road_address.address_name);
})
*/
...
...
Please
register
or
login
to post a comment