This is the Google Maps Places provider from the PHP Geocoder. This is a READ ONLY repository. See the main repo for information and documentation.
composer require geocoder-php/google-maps-places-providerhttps://developers.google.com/places/web-service
This provider often requires extra data when making queries, due to requirements of the underlying places API.
This provider supports two different modes of geocoding by text.
This is the default mode. It required an exact places name. It's not very forgiving, and generally only returns a single result
This mode will perform a search based on the input text.
It's a lot more forgiving that the find mode, but results will contain all fields and thus be billed at the highest rate.
$findResults = $provider->geocodeQuery(GeocodeQuery::create('Museum of Contemporary Art Australia')); // One Result
$searchResults = $provider->geocodeQuery(GeocodeQuery::create('art museum sydney'))
->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_SEARCH); // 20 ResultsWhen reverse geocoding, you are required to supply either a keyword, type or name.
See https://developers.google.com/places/web-service/search#PlaceSearchRequests
$results = $provider->reverseQuery(ReverseQuery::fromCoordinates(-33.892674, 151.200727)->withData('type', 'bar'));Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.
