/** * Get geo coodinates drom address * @param string * @param object * @return string */ function generateCoords($varValue, DataContainer $dc) { return $varValue ? $varValue : \delahaye\GeoCode::getCoordinates($dc->activeRecord->geocoderAddress, $dc->activeRecord->geocoderCountry, 'de'); }
/** * @param $strAddress Address string * @param $strCountry Country ISO 3166 code * * @return bool|string False if dlh_geocode is not installed, otherwise return the coordinates from address string */ private function generateCoordsFromAddress($strAddress, $strCountry) { if (!in_array('dlh_geocode', \ModuleLoader::getActive())) { return false; } return \delahaye\GeoCode::getCoordinates($strAddress, $strCountry, 'de'); }
/** * Get geo latitude from address * * @param string * @param object * * @return string */ function generateLongitude($varValue, DataContainer $dc) { if ($varValue) { return $varValue; } $varCoordinates = \delahaye\GeoCode::getCoordinates($dc->activeRecord->geocoderAddress, $dc->activeRecord->geocoderCountry, 'de'); $arrCoordinates = trimsplit(',', $varCoordinates); return $arrCoordinates[1]; }