3namespace Bitrix\Location\Source\Google;
5use Bitrix\Location\Geometry\Type\Point;
6use Bitrix\Location\StaticMap;
7use Bitrix\Location\StaticMap\StaticMapResult;
9use Bitrix\Main\Web\HttpClient;
14 private ?
string $backendKey;
21 'version' => HttpClient::HTTP_1_1,
33 if (is_null($this->backendKey))
35 $result->addError(
new Error(
'API key is not specified'));
41 'https://maps.googleapis.com/maps/api/staticmap?' . http_build_query([
57 'key' => $this->backendKey,
60 $status = $this->httpClient->getStatus();
71 ->setMimeType(
'image/png')
77 $this->backendKey = $backendKey;
getStaticMap(Point $point, int $zoom, int $width, int $height)
setBackendKey(?string $backendKey)
__construct(GoogleSource $source)