geocoder-php/GeocoderLaravel

How can I get multiple results from GoogleMaps when geocoding?

Closed this issue · 3 comments

Apologies if this is a silly question, but I wasn't able to get multiple results which I would get when using Google geocode API nativelly (on it's own).

Hi @cinilak :) There is no silly question !
The Geocoder ~2.x uses a ResultFactory. The DefaultResultFactory takes into account only the first result. If you need mutilple results you need to use the setter:

// ...
Geocoder::setResultFactory(new \Geocoder\Result\MultipleResultFactory);
// ...

Hope this will help you :) Feel free to open/comment this ticket if you need more assistance !

Lovely, thank you so much!

You're welcome :)