\GeoMashupGoogleGeocoder

HTTP geocoder using the Google geocoding web service

Summary

Methods
Properties
Constants
__construct()
geocode()
reverse_geocode()
$request_params
$language
$max_results
No constants found
url_utf8_encode()
$http
N/A
query()
No private properties found
N/A

Properties

$request_params

$request_params : array

Parameters to use with http requests.

Type

array

$language

$language : string

Language code.

Type

string

$max_results

$max_results : integer

Maximum number of results

Type

integer

$http

$http : float

WP_Http instance

Type

float

Methods

__construct()

__construct( $args)

Constructor

Parameters

$args

geocode()

geocode( $query) : array|\WP_Error

Look up locations from a text query, like an address or place name.

Parameters

$query

Returns

array|\WP_Error —

Array of search result locations.

reverse_geocode()

reverse_geocode( $lat,  $lng) : array|\WP_Error

Look up additional location information from coordinates.

Resulting locations have as much address information as possible filled in. Most services return the nearest match first, and some return only one.

Parameters

$lat
$lng

Returns

array|\WP_Error —

Array of search result locations.

url_utf8_encode()

url_utf8_encode( $text) : string

Convert a text term to UTF-8 if necessary before URL encoding.

Parameters

$text

Returns

string —

Encoded text.

query()

query(string $query_type, string $query) : array

Do regular or reverse geocoding

Parameters

string $query_type

'address' or 'latlng'

string $query

Returns

array —

Locations.