Completed
Push — master ( be45f4...df5ccc )
by Jeroen De
03:42
created

GeoJsonPage::getMapHtml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 6
cp 0
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\Presentation;
6
7
use Html;
8
9
class GeoJsonPage {
10
11
	public function getMapHtml(): string {
12
		return $this->wrapHtmlInThumbDivs(
13
			Html::rawElement(
14
				'div',
15
				[
16
					'id' => 'GeoJsonMap',
17
					'style' => "width: 100%; height: 600px; background-color: #eeeeee; overflow: hidden;",
18
					'class' => 'maps-map maps-leaflet GeoJsonMap'
19
				],
20
				wfMessage( 'maps-loading-map' )->inContentLanguage()->escaped()
21
			)
22
		);
23
	}
24
25
	private function wrapHtmlInThumbDivs( string $html ): string {
26
		return Html::rawElement(
27
			'div',
28
			[
29
				'class' => 'thumb'
30
			],
31
			Html::rawElement(
32
				'div',
33
				[
34
					'class' => 'thumbinner'
35
				],
36
				$html
37
			)
38
		);
39
	}
40
41
}
42