// Maximum levenshtein distance authorized between input and geocoded text in the whole text.
const MAX_TOTAL_DISTANCE = 6;
// Maximum levenshtein distance authorized between input and geocoded text in the whole text.
const MAX_TOTAL_DISTANCE = 6;
- public function getGeocodedAddress(Address &$address, $defaultLanguage = null, $forceLanguage = false) {
+ public function getGeocodedAddress(Address $address, $defaultLanguage = null, $forceLanguage = false) {
$this->prepareAddress($address);
$textAddress = $this->getTextToGeocode($address->text);
if (is_null($defaultLanguage)) {
$this->prepareAddress($address);
$textAddress = $this->getTextToGeocode($address->text);
if (is_null($defaultLanguage)) {
$address->geocodedText = null;
$address->geoloc_choice = null;
$address->countryId = null;
$address->geocodedText = null;
$address->geoloc_choice = null;
$address->countryId = null;
// Updates the address with the geocoded information from Google Maps. Also
// cleans up the final informations.
// Updates the address with the geocoded information from Google Maps. Also
// cleans up the final informations.
- private function getUpdatedAddress(Address &$address, array $geocodedData, $extraLines, $forceLanguage) {
+ private function getUpdatedAddress(Address $address, array $geocodedData, $extraLines, $forceLanguage) {
$this->fillAddressWithGeocoding($address, $geocodedData, false);
$this->formatAddress($address, $extraLines, $forceLanguage);
}
$this->fillAddressWithGeocoding($address, $geocodedData, false);
$this->formatAddress($address, $extraLines, $forceLanguage);
}
// The geocoded address three is
// Country -> AdministrativeArea -> SubAdministrativeArea -> Locality -> Thoroughfare
// with all the possible shortcuts
// The geocoded address three is
// Country -> AdministrativeArea -> SubAdministrativeArea -> Locality -> Thoroughfare
// with all the possible shortcuts
// Formats the text of the geocoded address using the unused data and
// compares it to the given address. If they are too different, the user
// will be asked to choose between them.
// Formats the text of the geocoded address using the unused data and
// compares it to the given address. If they are too different, the user
// will be asked to choose between them.