eo_remote_geocode
since 1.2
Pro
eo_remote_geocode( $address )
Given an address, returns the latitude-longtitude co-ordinates of that address.
By default uses Nominatim Search Service to geocode an address. The result is cached for 1 week.
Returns the an array of latitude-longtitude co-ordinates, indexed by 'lat', and 'lng'.
Applies the filter eventorganiser_remote_geocode
to allow plug-ins to change the service provider or append an API key
if this becomes necessary
Please note that this function is offered without any gurantee of accurracy. Please note that
the default service provider may in the future require an API key - this canbe added usign the
above filter
Example
The following retreives all events within 10 miles of Windsor Castle
$venue_query = array(
'proximity' => array(
'center' => eo_remote_geocode( "Windsor [castle]" ),
'distance' => 10,
'unit' => 'miles',
'compare' => '<='
),
);
$events = eo_get_events( array(
'event_start_after' => 'now',
'venue_query' => $venue_query,
));
Parameters
Return value
array
|
Indexed by 'lat' and 'lng'
|
Hooks
Changelog
Resources