-
Notifications
You must be signed in to change notification settings - Fork 523
Description
The Google Maps Provider uses the same endpoint for geocode and reverse lookup.
https://github.com/geocoder-php/Geocoder/blob/master/src/Geocoder/Provider/GoogleMaps.php#L33
'https://maps.googleapis.com/maps/api/geocode/json?address=%s';
Unfortunately, this is the wrong endpoint (or rather param) for reverse lookup. Prove:
Reverse: https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY
Although it's currently not the correct endpoint, it somehow works since google is smart enough to figure that out.
However, if you want to use result_type or location_type as request parameters they will just be ignored. (Reference to #546)
I'm able to send a PR to fix this.
My approach:
-
Get inspired by how the other providers (e.g.
BingMaps)handle different endpoints -
Implement it for the GoogleMapsProvider
Please add your thoughts and comments & tell me if you approve this approach.
I'd appreciate a quick answer, so I can get started fast.
Cheers,
Chris