/** Retrieves the set of locations. If Google returns a single set, then we get the geocode data and attach it to our query as a location object. Otherwise, we return a list of possible locations. */ function getLocations($q) { global $locations; $locations = array(); $googleData = getGoogleData($q); $count = substr_count($googleData, ",markers:["); #echo "count = $count<br/>"; if ($count > 0) { #echo "marker found<br/>"; $location = getGeocode($googleData, $q); $locations[] = $location; return $locations; } // want to retrieve all the different address choices #echo "location_functions.getLocations::multiple locations<br/>"; return getLocationOptions($googleData); }
/** An improved version of the getLocations method. */ function getLocations2($q) { $gData = getGoogleData($q); $locations = getGoogleLocations($gData); return $locations; }