react-native-geocoder
react-native-geocoder copied to clipboard
Allow `latitude` and `longitude` as position properties
Currently, Geocoder.geocodePosition() takes an object like:
{
lat: 40.7809261,
lng: -73.9637594,
}
this PR allows lat and lng to be latitude or longitude instead, respectively:
{
latitude: 40.7809261,
longitude: -73.9637594,
}
Just a little nicety for users.
I realised this would be nice to have when using this package alongside react-native-google-place-picker which returns latitude and longitude in it's response, allowing something like this:
RNGooglePlacePicker.show((response) => {
if (...) {
...
} else {
const { latitude, longitude } = response;
Geocoder.geocodePosition({ latitude, longitude }).then(...);
}
});