--- location.de.inc +++ location.de.inc.PATCHED @@ -252,7 +252,35 @@ if ($row = db_fetch_object($res)) { return array('lat' => $row->latitude, 'lon' => $row->longitude, 'city' => $row->city, 'province' => $row->state, 'country' => $row->country); } + else if (function_exists('location_latlon_rough_default')) { + // try to use default function, if it exists (if it got commited into location.inc in CVS, that is ;) + return location_latlon_rough_default($location); + } else { return NULL; } } + + +/** + * Returns a lat/lon pair of the approximate center of the given postal code in the given country + * + * THIS FUNCTION IS DEPRECATED AND JUST INCLUDED FOR BACKWARDS-COMPATIBILITY ! + * + * @param $location + * An associative array $location where only postal code and country are necessary, but can have the keys: + * 'street' => the street portion of the location + * 'supplemental' => additional street portion of the location + * 'province' => the province, state, or territory + * 'country' => lower-cased two-letter ISO code (REQUIRED) + * 'postal_code' => the international postal code for this location (REQUIRED) + * + * @return + * An associative array where + * 'lat' => approximate latitude of the center of the postal code's area + * 'lon' => approximate longitude of the center of the postal code's area + * + */ +function location_latlon_rough_de($location = array()) { + return location_get_postalcode_data_de($location); +}