Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling when multiple results are returned #15

Merged
merged 2 commits into from
Nov 21, 2021

Conversation

astiskala
Copy link

Currently, if there are multiple results, the component will iterate over each of them and take the values from the last result in the array.

Based on the Geocoding API documentation:

Generally, addresses are returned from most specific to least specific; the more exact address is the most prominent result

As such, it would make sense to take the values from the first result where they are available.

This change will check whether the value has already been populated from an earlier result, and if so, not override it with a later one.

@gregoryduckworth
Copy link
Owner

Looks good! Will push up these changes.

@gregoryduckworth gregoryduckworth merged commit 57acc37 into gregoryduckworth:master Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants