You are here

function geocoder_services_geocode in Geocoder 7

Callback for geocoding service.

Parameters

string $handler:

string $data:

string $format:

Return value

object

Throws

\Exception

1 string reference to 'geocoder_services_geocode'
geocoder_services_resources in ./geocoder.services.inc
Implements hook_services_resources().

File

./geocoder.services.inc, line 92
geocoder.services.inc

Code

function geocoder_services_geocode($handler, $data, $format = 'default') {
  geophp_load();
  geocoder_service_check_request($handler, $format);
  $geom = geocoder($handler, $data);
  if (!$format || $format === 'default') {
    $result = $geom
      ->out('json');
    return json_decode($result);
  }
  return $geom
    ->out($format);
}