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

Android: Why fetching 20 addresses? #81

Open
sanjeevraolade opened this issue Aug 21, 2018 · 3 comments
Open

Android: Why fetching 20 addresses? #81

sanjeevraolade opened this issue Aug 21, 2018 · 3 comments

Comments

@sanjeevraolade
Copy link

sanjeevraolade commented Aug 21, 2018

image
According to API, recommended is 1-5, but in this packager/api was hard - coded as 20. So may not get proper results ...

package API Code:
List<Address> addresses = geocoder.getFromLocation(position.getDouble("lat"), position.getDouble("lng"), 20);

It should be like

List<Address> addresses = geocoder.getFromLocation(position.getDouble("lat"), position.getDouble("lng"), 2);

OR

Give an option to user, so user can pass that value.
Hope you understood, what i am trying to explain..

@timwangdev
Copy link

Fixed in timwangdev/react-native-geocoder-reborn, now it only fetches 2 results.

@sanjeevraolade
Copy link
Author

@timwangdev Thanks for update. However, If control is given to user (who uses Geo code) to pass the noOfAddress would be a better idea. If nothing is passed you can default to 2 ..

@timwangdev
Copy link

@sanjeevraolade The iOS equivalent method CLGeocoder reverseGeocodeLocation don’t have simliar option to limit results. While in the most use cases only first object in the list would be used, since it is sorted by relevance by default.

Could you share the cases why number of address would be used?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants