3namespace Bitrix\Location\Source\Google\Converters;
5use Bitrix\Location\Entity\Address\FieldType;
6use Bitrix\Location\Entity\Location;
7use Bitrix\Location\Entity\Generic\Collection;
8use Bitrix\Location\Exception\RuntimeException;
9use Bitrix\Location\Source\Google;
24 if (isset(
$data[
'status']) &&
$data[
'status'] !==
'OK')
31 if (!isset(
$data[
'results']) || !is_array(
$data[
'results']))
38 foreach (
$data[
'results'] as $item)
40 if (isset($item[
'types']))
46 $type = FieldType::UNKNOWN;
51 ->setExternalId($item[
'place_id'])
52 ->setLongitude($item[
'geometry'][
'location'][
'lng'])
53 ->setLatitude($item[
'geometry'][
'location'][
'lat'])
55 ->setLanguageId($this->languageId);
58 if (is_array($item[
'address_components']))
60 if ($address = $this->
createAddress($item[
'address_components']))
62 $address->setLatitude(
$location->getLatitude());
63 $address->setLongitude(
$location->getLongitude());
66 if ($address->isFieldExist(FieldType::POSTAL_CODE))
70 $address->getFieldValue(FieldType::POSTAL_CODE)
75 if ($address->isFieldExist(
$type))
83 $location->setName($item[
'formatted_address']);
createAddress(array $addressComponents)
convertTypes(array $types, string $typesClass)
const CONVERTER_BYCOORDS_ERROR
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage