rezzza / google-geocoder
Easy wrap Google geocoder web service
Installs: 1 155
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 5
Forks: 5
Open Issues: 1
Requires
- php: >=5.6.0
- egeloen/http-adapter: ~1.0
- jakeasmith/http_build_url: ^1.0
Requires (Dev)
- atoum/atoum: ~1.0
- atoum/stubs: ~2.1
This package is not auto-updated.
Last update: 2022-02-01 12:50:08 UTC
README
Simple lib to wrap Google geocoder Web Service
Installation
$ composer require rezzza/google-geocoder
Usage
You should build on your own the repository :
$googleAddressRepository = new Rezzza\GoogleGeocoder\GoogleAddressRepository( new Rezzza\GoogleGeocoder\GoogleGeocodeClient( new Ivory\HttpAdapter\CurlHttpAdapter(), 'YOUR_GOOGLE_API_KEY' ), new Rezzza\GoogleGeocoder\Model\AddressFactory );
Then you can use all methods available in the repository :
findByPlaceIdWithLanguage($placeId, $language)
findByCoordinatesWithLanguage($latitude, $longitude, $language)
findByAddressWithLanguage($address, $language)
findByLocalityAndCountryCodeWithLanguage($locality, $countryCode, $language)
findByLocalityAndCountryCodeAndAministrativeAreaWithLanguage($locality, $countryCode, $administrativeArea, $language)
All these methods will return a Rezzza\GoogleGeocoder\Model\AddressCollection
except the first one that will return directly a Rezzza\GoogleGeocoder\Model\Address
(as a placeId is uniq).