Please provide the following:
- SDK Version: “expo”: “^34.0.1”,
- Platforms(web/all):
Hello, I am trying to set a marker on a click on maps on store the address at this marker.
Marker works fine but the Location.reverseGeocodeAsync(coords) returns me address objects which only have {city, region, country, postalCode}, What should I do to get precise address?
Here is the code I call onClick on the map :
_attemptReverseGeocodeAsync = async (coords) => {
try {
let result = await Location.reverseGeocodeAsync(coords);
return result;
} catch (e) {
return e;
}
};
onPress = (position) => {
const coords = {latitude:position.latLng.lat(), longitude:position.latLng.lng()};
console.log("coords", coords);
this._attemptReverseGeocodeAsync(coords).then(result => {
console.log(result);
})
.catch((error)=> {
console.log(error);
})
Permission and google api key are set in component did mount.
ADDITIONNAL INFO :
My sample function comes from this snack, from which the address comes correctly with street name and number