Skip to content
This repository was archived by the owner on Sep 4, 2021. It is now read-only.

Conversation

pcfutures
Copy link

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(...);
    }
});

PC Futures added 3 commits August 25, 2017 14:38
Changes `Geocoder.geocodePosition()` to allow `latitude` and `longitude` as well as `lat` and `lng`.
Updates README.md to signify that `latitude` and `longitude` can be used.
`apiKey`, `position` and `address` don't need to be checked here as they're already checked before these functions are called!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant