\GeoMashupHttpGeocoder

The Geo Mashup Http Geocoder base class.

Summary

Methods
Properties
Constants
__construct()
geocode()
reverse_geocode()
$request_params
$language
$max_results
No constants found
url_utf8_encode()
$http
N/A
No private methods found
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(string $args)

Constructor

Parameters

string $args

Optional array of arguments:

    language - two digit language code, defaults to blog language
    max_results - maximum number of results to fetch
    default http params - array of WP_Http request parameters, including timeout

geocode()

geocode(string $query) : array|\WP_Error

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

Parameters

string $query

Text query.

Returns

array|\WP_Error —

Array of search result locations.

reverse_geocode()

reverse_geocode(float $lat, float $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

float $lat

Latitude

float $lng

Longitude

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.