Geocoder Google Maps Places adapter

1.1.0 2020-07-04 13:18 UTC

This package is auto-updated.

Last update: 2020-09-04 14:12:25 UTC


Build Status Latest Stable Version Total Downloads Monthly Downloads Code Coverage Quality Score Software License

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-provider

API Documentation


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.

Find Mode

This is the default mode. It required an exact places name. It's not very forgiving, and generally only returns a single result

Search Mode

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 Results

Reverse Geocoding

When reverse geocoding, you are required to supply either a keyword, type or name. See

$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.