function locate($gapikey, $location, $cache = null) { // check if location are lng / lat values $location = trim($location); if (ereg('([0-9.-]{1,}),([0-9.-]{1,})', $location, $regs)) { if ($location == $regs[0]) { return array('lat' => $regs[1], 'lng' => $regs[2]); } } // use geocode to translate location return modYOOmapsHelper::geoCode($gapikey, $location, $cache); }