geocoder-php / GeocoderLaravel

Geocoder service provider for Laravel
http://geocoder-php.org/GeocoderLaravel/
MIT License
704 stars 102 forks source link

Location mismatch with Geocoder #167

Open extraric opened 4 years ago

extraric commented 4 years ago

General Information

GeocoderLaravel Version: 4.2.4 Laravel Version: 5.7 PHP Version: 7.2.7 Operating System and Version: SLES 12

Issue Description

I don't know if it's just my fault, but i get different result for GeocodeLaravel:

$address="1182 Budapest, Királyhágó utca 112/ B, Hungary";
$result1 = Geocoder::geocode($address)->get();
//result1 formattedAddress: "Budapest, Királyhágó u. 112b, 1201 Hungary"

and Geocode:

$httpClient = new \Http\Client\Curl\Client();
$provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient, null, 'apikey');
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'hu');
$result2 = $geocoder->geocodeQuery(\Geocoder\Query\GeocodeQuery::create($addresses));
//result2 formattedAddress: "Budapest, Királyhágó u. 112, 1182 Hungary"

Looks like first one ignore postalcode. What am I miss?

extraric commented 4 years ago

If I think right it has something to do with locale setting, what I can not set directly on the first case? #159

mikebronner commented 4 years ago

Thanks for the update on this. Any PRs are welcomed, as I am fairly swamped at the moment.

mikebronner commented 4 years ago

@extraric If its the locale setting, you must set that in the config file.