Completed
Push — master ( 81538e...c2bf57 )
by Jeroen De
10:06
created

ImageOverlay::getImage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\LegacyModel;
6
7
use DataValues\Geo\Values\LatLongValue;
8
9
/**
10
 * @since 3.0
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Kim Eik < [email protected] >
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class ImageOverlay extends Rectangle {
17
18
	private $imageUrl;
19
20
	public function __construct( LatLongValue $boundsNorthEast, LatLongValue $boundsSouthWest, string $image ) {
21
		parent::__construct( $boundsNorthEast, $boundsSouthWest );
22
23
		$this->imageUrl = $image;
24
	}
25
26
	public function getImage(): string {
27
		return $this->imageUrl;
28
	}
29
30
	public function getJSONObject( string $defText = '', string $defTitle = '' ): array {
31
		$data = parent::getJSONObject( $defText, $defTitle );
32
33
		$data['image'] = $this->imageUrl;
34
35
		return $data;
36
	}
37
38
}
39