You are here

function locationmap_geocode_for_address_recursive in Location Map 7

Same name and namespace in other branches
  1. 8.2 locationmap.module \locationmap_geocode_for_address_recursive()
  2. 7.2 locationmap.module \locationmap_geocode_for_address_recursive()

Try to get lat and lng information from address removing parts of address if not found.

2 calls to locationmap_geocode_for_address_recursive()
locationmapTest::test_locationmap_geocode_for_address_recursive in tests/locationmap.test
locationmap_admin_settings_validate in ./locationmap.module
@todo Please document this function.

File

./locationmap.module, line 280

Code

function locationmap_geocode_for_address_recursive($address) {
  while (TRUE) {
    $latlng = locationmap_geocode_for_address($address);
    if ($latlng) {
      return $latlng;
    }
    if (strpos($address, ',') === FALSE) {
      return FALSE;
    }
    $address = preg_replace('/[^,]+,/', '', $address, 1);
  }
  return FALSE;
}