The following is example taken from the Google Maps node module
function doSomeGeoCode() {
const googleMapsClient = require('@google/maps').createClient({
key: 'your API key here',
Promise: Promise
});
googleMapsClient.geocode({address: '1600 Amphitheatre Parkway, Mountain
View, CA'})
.asPromise()
.then((response) => {
console.log(response.json.results);
})
.catch((err) => {
console.log(err);
});
}
如何使用 async 和 await 调用 doSomeGeoCode。我还需要在收到响应后调用另一个函数。请建议