I have a bunch of code that should return me coordinates considering an address. The documentation of this module gives this example:
Geocode.fromAddress("Eiffel Tower").then(
response => {
const { lat, lng } = response.results[0].geometry.location;
console.log(lat, lng);
},
error => {
console.error(error);
}
);
which prints 2 coordinates.
Now, my code is done this way:
const geoShopLocation = async () => {
const location = await Geocode.fromAddress(product.addressLine1)
.results[0].geometry.location
return location
}
const shopLocation = geoShopLocation()
console.log(shopLocation)
But at console.log level, I get this output, which I presume it's the full promise:
Promise {
"_U": 0,
"_V": 0,
"_W": null,
"_X": null,
}
I am trying every possible solution for this but I always get a promise back or "undefined". Can someone give me a hint for this?