-
Notifications
You must be signed in to change notification settings - Fork 523
Retrieving Multiple Results from Google #223
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
Conversation
|
Yeah, not sure why I didn't just go that route. Also, I think I botched my commit for this pull request. I made it against a tagged version, then copied it in for master and might have messed things up. Feel free to ignore the pull request, but please consider the idea :-) If you want me to come up with something with a toggle for it, I'd be glad to contribute. |
|
I think it's a good idea to change the I wonder how many providers return more than one result though.. |
|
We can add a new method in the |
|
How would you maintain state between the two calls ( |
|
Well I guess the I think extending the |
|
We can provide two differnet Simple implementation: https://gist.github.com/Baachi/ea8f67e2f5329515c2c3 @willdurand What do you think? |
|
@Baachi well, it looks good. |
|
@Baachi good idea 👍 |
Added: DefaultResultFactory and MultipleResultFactory classes - Fix #223
This is by no means a complete implementation as I have only handled GoogleMaps, although the other providers should still work fine.
I have a use case for retrieving multiple results from Google and displaying them to the user to pick the correct one. This library only returns the first result, though.
I have modified the code to return all results from GoogleMaps, returning an array if there is more than one or a Result if there is only one.
Maybe for backwards compatibility, this could be controlled with some kind of config toggle. This pull request isn't meant to be accepted straight out, but to illustrate what I desire to achieve and how it could be achieved. Thoughts? Ideas?