You are here

function geocoder_reverse in Geocoder 7

The Geocoder API call. TODO.

File

./geocoder.module, line 19

Code

function geocoder_reverse($handler, $lat, $long, $options = array(), $cache_type = 2, $cache_reset = FALSE) {
  ctools_include('plugins');
  static $static_cache_reverse = array();
  if ($cache_reset) {
    $static_cache_reverse = array();
  }
  if ($cache_type) {
    $cache_id = $handler . '_' . md5(serialize(array(
      $lat,
      $long,
      $options,
    )));
    if (!empty($static_cache_reverse[$cache_id])) {
      return $static_cache_reverse[$cache_id];
    }
  }
  $processor = ctools_get_plugins('geocoder', 'geocoder_reverse_handler', $handler);
  $address = call_user_func($processor['callback'], $lat, $long, $options);
  if ($cache_type) {
    $static_cache_reverse[$cache_id] = $address;
  }
  return $address;
}