Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default Geocoder = {
else if (params[0] instanceof Array)
queryParams = {latlng : `${params[0][0]},${params[0][1]}`};

// {place_id}
else if (params[0] instanceof Object && params[0].hasOwnProperty('place_id'))
queryParams = {place_id : `${params[0].place_id}`};

// {latitude, longitude} or {lat, lng}
else if (params[0] instanceof Object)
queryParams = {latlng : `${params[0].lat || params[0].latitude},${params[0].lng || params[0].longitude}`};
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ Geocoder.from({

// array
Geocoder.from([41.89, 12.49]);

// object with place_id, provided by Google Places Api
Geocoder.from({
place_id: 'ChIJgUbEo8cfqokR5lP9_Wh_DaM'
});

```

# Error Codes
Expand Down