저는 자바 스크립트가 제 경험이 제한적이라고 생각합니다. 내가 구글로 Node.js를 클라이언트 라이브러리를 사용하고 , 여기 - https://github.com/googlemaps/google-maps-services-js 예는 gecode 요청을 실행하고 결과를 인쇄하는 방법을 다음node.js Google지도 클라이언트 라이브러리 사용
var googleMapsClient = require('@google/maps').createClient({
key: 'your API key here'
});
클라이언트 객체를 생성하는 방법을 보여줍니다
// Geocode an address.
googleMapsClient.geocode({
address: '1600 Amphitheatre Parkway, Mountain View, CA'
}, function(err, response) {
if (!err) {
console.log(response.json.results);
}
});
내가해야할 일은 파일에서 주소 목록을 읽고 모든 파일에 대한 개체 배열을 작성하는 것입니다.
나는 내 코드의 라인을 따라 뭔가를하고 싶지 :
create address-objects array
create a client object
open the text files
for each line in text files
geocode the line(address)
add the address and the results into an object and add it to the address-objects
나는 그래 난 그것을 어떻게 액세스합니까 경우 googleMapsClient.geocode이 뭔가를 반환 여부를 이해하지? 사전 조나단에서 나는 분명했다
var gc_results = googleMapsClient.geocode(param , ...)
희망, 감사 : 나는의 라인을 따라 몇 가지 변수를 설정해야합니다.