Android: Why fetching 20 addresses?
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..
Fixed in timwangdev/react-native-geocoder-reborn, now it only fetches 2 results.
@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 ..
@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?