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

Allow latitude and longitude as position properties #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Allow latitude and longitude as position properties #57

wants to merge 3 commits into from

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.

None yet

1 participant