-
getAddress()
return
-
await
then()
async getAddress() {
// notice, no then(), cause await would block and
// wait for the resolved result
const position = await this.getCoordinates();
let latitude = position.coords.latitude;
let longitude = position.coords.longitude;
let url = Constants.OSMAP_URL + latitude + "&lon=" + longitude;
// Actually return a value
return this.reverseGeoCode(url);
}
reverseGeoCode
async reverseGeoCode(url) {
let requestService = new RequestService("json", url);
return await requestService.call();
}