1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
sourcestaticmapservice.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Location\Source\Osm;
4
5
use Bitrix\Location\Geometry\Type\Point;
6
use Bitrix\Location\StaticMap\StaticMapResult;
7
use Bitrix\Main\Error;
8
use Bitrix\Location\StaticMap;
9
10
final
class
SourceStaticMapService
extends
StaticMap\SourceStaticMapService
11
{
12
private
Api\Api
$api;
13
14
public
function
__construct
(
OsmSource
$source
)
15
{
16
parent::__construct(
$source
);
17
18
$this->api =
new
Api\Api
(
$source
);
19
}
20
21
public
function
getStaticMap
(
Point
$point,
int
$zoom,
int
$width
,
int
$height):
StaticMapResult
22
{
23
$result
=
new
StaticMapResult
();
24
25
$staticMapResult = $this->api->getStaticMap(
26
$point->
getLat
(),
27
$point->
getLng
(),
28
$zoom,
29
$width
,
30
$height
31
);
32
33
if
($staticMapResult[
'status'
] !==
'success'
)
34
{
35
$result
->addError(
new
Error
(
'Service request error'
));
36
37
return
$result
;
38
}
39
40
return
$result
41
->setContent($staticMapResult[
'data'
])
42
->setMimeType(
'image/png'
)
43
;
44
}
45
}
Bitrix\Location\Geometry\Type\Point
Определения
point.php:8
Bitrix\Location\Geometry\Type\Point\getLng
getLng()
Определения
point.php:50
Bitrix\Location\Geometry\Type\Point\getLat
getLat()
Определения
point.php:42
Bitrix\Location\Source\Osm\Api\Api
Определения
api.php:18
Bitrix\Location\Source\Osm\OsmSource
Определения
osmsource.php:20
Bitrix\Location\Source\Osm\SourceStaticMapService
Определения
sourcestaticmapservice.php:11
Bitrix\Location\Source\Osm\SourceStaticMapService\getStaticMap
getStaticMap(Point $point, int $zoom, int $width, int $height)
Определения
sourcestaticmapservice.php:21
Bitrix\Location\Source\Osm\SourceStaticMapService\__construct
__construct(OsmSource $source)
Определения
sourcestaticmapservice.php:14
Bitrix\Location\StaticMap\SourceStaticMapService
Определения
sourcestaticmapservice.php:9
Bitrix\Location\StaticMap\SourceStaticMapService\$source
Source $source
Определения
sourcestaticmapservice.php:10
Bitrix\Location\StaticMap\StaticMapResult
Определения
staticmapresult.php:8
Bitrix\Main\Error
Определения
error.php:15
$result
$result
Определения
get_property_values.php:14
$width
$width
Определения
html.php:68
bitrix
modules
location
lib
source
osm
sourcestaticmapservice.php
Создано системой
1.14.0