Symbiote\Addressable\GoogleGeocodeService
A utility class for geocoding addresses using the google maps API.
Synopsis
class GoogleGeocodeService
implements
GeocodeServiceInterface
{
- // constants
- const ERROR_ZERO_RESULTS = 'ZERO_RESULTS';
- const ERROR_OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT';
- // members
- private static string $google_api_url = 'https://maps.googleapis.com/maps/api/geocode/xml';
- private static string $google_api_key = '';
- // methods
- public void getApiKey()
- public void getApiUrl()
- public array addressToPoint()
Hierarchy
Implements
Constants
Name | Value |
---|---|
ERROR_ZERO_RESULTS | 'ZERO_RESULTS' |
ERROR_OVER_QUERY_LIMIT | 'OVER_QUERY_LIMIT' |
Members
private
- $google_api_key — string
- $google_api_url — string
Methods
public
- addressToPoint() — Convert an address into a latitude and longitude.
- getApiKey() — Retrieve the Google Geocoding API key from environment or config API
- getApiUrl() — Retrieve the Google Geocoding API URL from config API