1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
staticmap.php
См. документацию.
1<?php
2
3namespace Bitrix\Location\Controller;
4
5use Bitrix\Location\Service\StaticMapService;
6use Bitrix\Main\Engine\Controller;
7use Bitrix\Main\Error;
8
9class StaticMap extends Controller
10{
11 public function getAction(
12 float $latitude,
13 float $longitude,
14 int $zoom,
15 int $width,
16 int $height
17 ): ?string
18 {
19 $requestMapResult = StaticMapService::getInstance()->getStaticMap(
20 $latitude,
21 $longitude,
22 $zoom,
23 $width,
24 $height
25 );
26
27 if (!$requestMapResult->isSuccess())
28 {
29 $this->addErrors($requestMapResult->getErrors());
30
31 return null;
32 }
33
34 $path = $requestMapResult->getPath();
35 if (empty($path))
36 {
37 $this->addError(new Error('Service error'));
38
39 return null;
40 }
41
42 return $path;
43 }
44}
$path
Определения access_edit.php:21
getAction(float $latitude, float $longitude, int $zoom, int $width, int $height)
Определения staticmap.php:11
Определения error.php:15
$width
Определения html.php:68