Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class MapLayerRenderer implements LayerRendererInterface |
||
15 | { |
||
16 | private LayerInterface $layer; |
||
17 | |||
18 | private EncodedMapInterface $encodedMap; |
||
19 | |||
20 | 2 | public function __construct(LayerInterface $layer, EncodedMapInterface $encodedMap) |
|
24 | } |
||
25 | |||
26 | /** @param MapData $data */ |
||
27 | 2 | public function render(CellDataInterface $data, AbstractVisualPanel $panel): string |
|
28 | { |
||
29 | 2 | return sprintf( |
|
30 | 2 | '<img src="/assets/map/%s" style="z-index: %d; %s opacity:1;" />', |
|
31 | 2 | $this->getMapGraphicPath($data), |
|
32 | 2 | PanelLayerEnum::MAP->value, |
|
33 | 2 | $panel->getHeightAndWidth() |
|
34 | 2 | ); |
|
35 | } |
||
36 | |||
37 | 2 | private function getMapGraphicPath(MapData $data): string |
|
49 | } |
||
50 | } |
||
51 |