Tag: 客户端库

使用node.js谷歌地图客户端库

我认为这与我有限的JavaScript经验有关。 我使用Google的node.js客户端库,在这里find – https://github.com/googlemaps/google-maps-services-js这个例子展示了如何创build一个客户端对象 var googleMapsClient = require('@google/maps').createClient({ key: 'your API key here' }); 然后如何运行gecode请求并打印出结果: // Geocode an address. googleMapsClient.geocode({ address: '1600 Amphitheatre Parkway, Mountain View, CA' }, function(err, response) { if (!err) { console.log(response.json.results); } }); 我需要做的是从文件中读取一个地址列表,并为它们build立一个对象数组。 我希望我的代码能够按照以下方式进行操作: create address-objects array create a client object open the text files for each line in text […]