3namespace Bitrix\Location\Source;
5use Bitrix\Location\Entity\Source\Factory;
6use Bitrix\Location\Entity\Source\OrmConverter;
7use Bitrix\Location\Infrastructure\SourceCodePicker;
8use Bitrix\Location\Repository\SourceRepository;
9use Bitrix\Location\Source\Google;
10use Bitrix\Location\Source\Osm;
11use Bitrix\Main\Result;
26 $source = $this->sourceRepository->findByCode($sourceCode);
30 $source = Factory::makeSource($sourceCode);
31 $source->setName($sourceCode);
38 $res = $this->sourceRepository->save($source);
40 if(!
$res->isSuccess())
45 SourceCodePicker::setSourceCode($sourceCode);
52 $sourceSelector =
new self();
54 return $sourceSelector->setSource(Factory::GOOGLE_SOURCE_CODE, $configFactory);
59 $sourceSelector =
new self();
61 return $sourceSelector->setSource(Factory::OSM_SOURCE_CODE, $configFactory);
static setOsmSource(string $serviceUrl, string $token)
static setGoogleSource(string $frontendKey, string $backendKey)
setSource(string $sourceCode, IConfigFactory $configFactory)
__construct(SourceRepository $sourceRepository=null)