1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Ivory Google Map package. |
5
|
|
|
* |
6
|
|
|
* (c) Eric GELOEN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Ivory\GoogleMap\Overlay; |
13
|
|
|
|
14
|
|
|
use Ivory\GoogleMap\Base\Point; |
15
|
|
|
use Ivory\GoogleMap\Utility\OptionsAwareInterface; |
16
|
|
|
use Ivory\GoogleMap\Utility\OptionsAwareTrait; |
17
|
|
|
use Ivory\GoogleMap\Utility\VariableAwareInterface; |
18
|
|
|
use Ivory\GoogleMap\Utility\VariableAwareTrait; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @see http://code.google.com/apis/maps/documentation/javascript/reference#Symbol |
22
|
|
|
* |
23
|
|
|
* @author GeLo <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
class Symbol implements OptionsAwareInterface, VariableAwareInterface |
26
|
|
|
{ |
27
|
|
|
use OptionsAwareTrait; |
28
|
|
|
use VariableAwareTrait; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
private $path; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var Point|null |
37
|
|
|
*/ |
38
|
|
|
private $anchor; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var Point|null |
42
|
|
|
*/ |
43
|
|
|
private $labelOrigin; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @param string $path |
47
|
|
|
* @param Point|null $anchor |
48
|
|
|
* @param Point|null $labelOrigin |
49
|
|
|
* @param array $options |
50
|
|
|
*/ |
51
|
72 |
|
public function __construct($path, Point $anchor = null, Point $labelOrigin = null, array $options = []) |
52
|
|
|
{ |
53
|
72 |
|
$this->setPath($path); |
54
|
72 |
|
$this->setAnchor($anchor); |
55
|
72 |
|
$this->setLabelOrigin($labelOrigin); |
56
|
72 |
|
$this->setOptions($options); |
57
|
72 |
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @return string |
61
|
|
|
*/ |
62
|
24 |
|
public function getPath() |
63
|
|
|
{ |
64
|
24 |
|
return $this->path; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @param string $path |
69
|
|
|
*/ |
70
|
72 |
|
public function setPath($path) |
71
|
|
|
{ |
72
|
72 |
|
$this->path = $path; |
73
|
72 |
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return bool |
77
|
|
|
*/ |
78
|
28 |
|
public function hasAnchor() |
79
|
|
|
{ |
80
|
28 |
|
return $this->anchor !== null; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @return Point|null |
85
|
|
|
*/ |
86
|
20 |
|
public function getAnchor() |
87
|
|
|
{ |
88
|
20 |
|
return $this->anchor; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @param Point|null $anchor |
93
|
|
|
*/ |
94
|
72 |
|
public function setAnchor(Point $anchor = null) |
95
|
|
|
{ |
96
|
72 |
|
$this->anchor = $anchor; |
97
|
72 |
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return bool |
101
|
|
|
*/ |
102
|
28 |
|
public function hasLabelOrigin() |
103
|
|
|
{ |
104
|
28 |
|
return $this->labelOrigin !== null; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return Point|null |
109
|
|
|
*/ |
110
|
20 |
|
public function getLabelOrigin() |
111
|
|
|
{ |
112
|
20 |
|
return $this->labelOrigin; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @param Point|null $labelOrigin |
117
|
|
|
*/ |
118
|
72 |
|
public function setLabelOrigin(Point $labelOrigin = null) |
119
|
|
|
{ |
120
|
72 |
|
$this->labelOrigin = $labelOrigin; |
121
|
72 |
|
} |
122
|
|
|
} |
123
|
|
|
|