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);
});
}
Run Code Online (Sandbox Code Playgroud)
如何使用async和await调用doSomeGeoCode。同样,一旦收到响应,我就需要调用另一个函数。请建议