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

Android: Why fetching 20 addresses? #81

Open

Description

@sanjeevraolade

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..

Activity

  1. timwangdev commented on Nov 27, 2018

    @timwangdev

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

  2. sanjeevraolade commented on Nov 27, 2018

    @sanjeevraolade
    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 ..

  3. timwangdev commented on Nov 29, 2018

    @timwangdev

    @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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions