Issue
Hi im using react native and I want to get my current locations city name can anyone help me with this issue?? I dont get the response at all. I have already tried...
Code:
componentDidMount(){
navigator.geolocation.getCurrentPosition(
(position) => {
try {
Geocoder.geocodePosition({ position.coords.latitude, position.coords.longitude }.then(res =>
console.log(res);
} catch(err) {
console.log(err);
}
},
(error) => this.setState({ error: error.message }),
{ enableHighAccuracy: false, timeout: 200000, maximumAge: 1000 },
);
}
Solution
React Native did not support Inverse Geocoding (from location to administrative information). Check this answer : Use Geocoder to return the device address
Answered By - Walter Palladino
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.