|
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\Service\Base; |
|
13
|
|
|
|
|
14
|
|
|
use Ivory\GoogleMap\Base\Bound; |
|
15
|
|
|
use Ivory\GoogleMap\Base\Coordinate; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @author GeLo <[email protected]> |
|
19
|
|
|
*/ |
|
20
|
|
|
class Geometry |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @var Coordinate|null |
|
24
|
|
|
*/ |
|
25
|
|
|
private $location; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @var string|null |
|
29
|
|
|
*/ |
|
30
|
|
|
private $locationType; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @var Bound|null |
|
34
|
|
|
*/ |
|
35
|
|
|
private $viewport; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @var Bound|null |
|
39
|
|
|
*/ |
|
40
|
|
|
private $bound; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @return bool |
|
44
|
|
|
*/ |
|
45
|
|
|
public function hasLocation() |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->location !== null; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @return Coordinate|null |
|
52
|
|
|
*/ |
|
53
|
|
|
public function getLocation() |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->location; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param Coordinate|null $location |
|
60
|
|
|
*/ |
|
61
|
|
|
public function setLocation(Coordinate $location = null) |
|
62
|
|
|
{ |
|
63
|
|
|
$this->location = $location; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @return bool |
|
68
|
|
|
*/ |
|
69
|
|
|
public function hasLocationType() |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->locationType !== null; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return string|null |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getLocationType() |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->locationType; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @param string|null $locationType |
|
84
|
|
|
*/ |
|
85
|
|
|
public function setLocationType($locationType = null) |
|
86
|
|
|
{ |
|
87
|
|
|
$this->locationType = $locationType; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return bool |
|
92
|
|
|
*/ |
|
93
|
|
|
public function hasViewport() |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->viewport !== null; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @return Bound|null |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getViewport() |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->viewport; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @param Bound|null $viewport |
|
108
|
|
|
*/ |
|
109
|
|
|
public function setViewport(Bound $viewport = null) |
|
110
|
|
|
{ |
|
111
|
|
|
$this->viewport = $viewport; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @return bool |
|
116
|
|
|
*/ |
|
117
|
|
|
public function hasBound() |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->bound !== null; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return Bound|null |
|
124
|
|
|
*/ |
|
125
|
|
|
public function getBound() |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->bound; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param Bound|null $bound |
|
132
|
|
|
*/ |
|
133
|
|
|
public function setBound(Bound $bound = null) |
|
134
|
|
|
{ |
|
135
|
|
|
$this->bound = $bound; |
|
136
|
|
|
} |
|
137
|
|
|
} |
|
138
|
|
|
|