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

Polygon::setFillOpacity()   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 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\LegacyModel;
6
7
/**
8
 * @since 3.0
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Kim Eik < [email protected] >
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class Polygon extends Line {
15
16
	private $onlyVisibleOnHover = false;
17
	private $fillOpacity = '0.5';
18
	private $fillColor = '#FF0000';
19
20
	public function isOnlyVisibleOnHover(): bool {
21
		return $this->onlyVisibleOnHover;
22
	}
23
24
	public function setOnlyVisibleOnHover( bool $visible ) {
25
		$this->onlyVisibleOnHover = $visible;
26
	}
27
28
	public function setFillOpacity( string $fillOpacity ) {
29
		$this->fillOpacity = $fillOpacity;
30
	}
31
32
	public function setFillColor( string $fillColor ) {
33
		$this->fillColor = $fillColor;
34
	}
35
36
	public function getJSONObject( string $defText = '', string $defTitle = '' ): array {
37
		$json = parent::getJSONObject( $defText, $defTitle );
38
39
		$json['onlyVisibleOnHover'] = $this->onlyVisibleOnHover;
40
		$json['fillColor'] = $this->fillColor;
41
		$json['fillOpacity'] = $this->fillOpacity;
42
43
		return $json;
44
	}
45
46
}
47