Skip to content
[READ ONLY] Provider for GoogleMapsPlaces
PHP
Branch: master
Clone or download
Nyholm Updated branch alias (#1000)
* Updated branch alias

* Updated branch alias
Latest commit c5abc28 Aug 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Model feat: implement google maps places provider (#980) Aug 5, 2019
Tests feat: implement google maps places provider (#980) Aug 5, 2019
.gitattributes
.gitignore feat: implement google maps places provider (#980) Aug 5, 2019
.travis.yml feat: implement google maps places provider (#980) Aug 5, 2019
CHANGELOG.md
GoogleMapsPlaces.php
LICENSE feat: implement google maps places provider (#980) Aug 5, 2019
README.md
composer.json Updated branch alias (#1000) Aug 14, 2019
phpunit.xml.dist feat: implement google maps places provider (#980) Aug 5, 2019

README.md

Google Maps Geocoder provider

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.

Install

composer require geocoder-php/google-maps-places-provider

API Documentation

https://developers.google.com/places/web-service

Usage

This provider often requires extra data when making queries, due to requirements of the underlying places API.

Geocoding

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 https://developers.google.com/places/web-service/search#PlaceSearchRequests

$results = $provider->reverseQuery(ReverseQuery::fromCoordinates(-33.892674, 151.200727)->withData('type', 'bar'));

Contribute

Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.

You can’t perform that action at this time.