You are here

function geocoder_latlon in Geocoder 7

Process Markup.

1 call to geocoder_latlon()
geocoder_latlon_field in plugins/geocoder_handler/latlon.inc
Plugin callback.
1 string reference to 'geocoder_latlon'
latlon.inc in plugins/geocoder_handler/latlon.inc

File

plugins/geocoder_handler/latlon.inc, line 19

Code

function geocoder_latlon($latlon_string, $options = array()) {
  geophp_load();
  $delims = array(
    ',',
    '/',
    ' ',
    "\t",
  );
  foreach ($delims as $delim) {
    $parts = explode($delim, $latlon_string);
    if (count($parts) === 2) {
      $lat = geocoder_latlon_dms_to_dec(trim($parts[0]));
      $lon = geocoder_latlon_dms_to_dec(trim($parts[1]));
      return new Point($lon, $lat);
    }
  }

  // Failed to parse.
  return FALSE;
}