1 | <?php |
||
18 | class Location extends BaseElement { |
||
19 | |||
20 | /** |
||
21 | * @var LatLongValue |
||
22 | */ |
||
23 | private $coordinates; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $address; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $icon = ''; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $group = ''; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $inlineLabel = ''; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | private $visitedIcon = ''; |
||
49 | |||
50 | /** |
||
51 | * Creates and returns a new instance of a Location from a latitude and longitude. |
||
52 | * |
||
53 | * @since 1.0 |
||
54 | * |
||
55 | * @param float $lat |
||
56 | * @param float $lon |
||
57 | * |
||
58 | * @return Location |
||
59 | */ |
||
60 | public static function newFromLatLon( $lat, $lon ) { |
||
63 | |||
64 | public function __construct( LatLongValue $coordinates ) { |
||
68 | |||
69 | /** |
||
70 | * Returns the locations coordinates. |
||
71 | * |
||
72 | * @since 3.0 |
||
73 | * |
||
74 | * @return LatLongValue |
||
75 | */ |
||
76 | public function getCoordinates() { |
||
79 | |||
80 | /** |
||
81 | * Returns the address corresponding to this location. |
||
82 | * If there is none, and empty sting is returned. |
||
83 | * |
||
84 | * @since 0.7.1 |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getAddress() { |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Returns if there is any icon. |
||
99 | * |
||
100 | * @since 1.0 |
||
101 | * |
||
102 | * @return boolean |
||
103 | */ |
||
104 | public function hasIcon() { |
||
107 | |||
108 | /** |
||
109 | * Sets the icon |
||
110 | * |
||
111 | * @since 0.7.2 |
||
112 | * |
||
113 | * @param string $icon |
||
114 | */ |
||
115 | public function setIcon( $icon ) { |
||
118 | |||
119 | /** |
||
120 | * Sets the group |
||
121 | * |
||
122 | * @since 2.0 |
||
123 | * |
||
124 | * @param string $group |
||
125 | */ |
||
126 | public function setGroup( $group ) { |
||
129 | |||
130 | /** |
||
131 | * Returns the icon. |
||
132 | * |
||
133 | * @since 0.7.2 |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getIcon() { |
||
140 | |||
141 | /** |
||
142 | * Returns the group. |
||
143 | * |
||
144 | * @since 2.0 |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getGroup() { |
||
151 | |||
152 | /** |
||
153 | * Returns whether Location is assigned to a group. |
||
154 | * |
||
155 | * @since 2.0 |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | public function hasGroup() { |
||
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | * @since 2.0 |
||
166 | */ |
||
167 | public function getInlineLabel(){ |
||
170 | |||
171 | /** |
||
172 | * @param $label |
||
173 | * @since 2.0 |
||
174 | */ |
||
175 | public function setInlineLabel($label){ |
||
178 | |||
179 | /** |
||
180 | * @return bool |
||
181 | * @since 2.0 |
||
182 | */ |
||
183 | public function hasInlineLabel(){ |
||
186 | |||
187 | /** |
||
188 | * @return string |
||
189 | * @since 2.0 |
||
190 | */ |
||
191 | public function getVisitedIcon() { |
||
194 | |||
195 | /** |
||
196 | * @param $visitedIcon |
||
197 | * @since 2.0 |
||
198 | */ |
||
199 | public function setVisitedIcon( $visitedIcon ) { |
||
202 | |||
203 | /** |
||
204 | * @return bool |
||
205 | * @since 2.0 |
||
206 | */ |
||
207 | public function hasVisitedIcon(){ |
||
210 | |||
211 | /** |
||
212 | * Returns an object that can directly be converted to JS using json_encode or similar. |
||
213 | * |
||
214 | * FIXME: complexity |
||
215 | * |
||
216 | * @since 1.0 |
||
217 | * |
||
218 | * @param string $defText |
||
219 | * @param string $defTitle |
||
220 | * @param string $defIconUrl |
||
221 | * @param string $defGroup |
||
222 | * @param string $defInlineLabel |
||
223 | * @param string $defVisitedIcon |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function getJSONObject( $defText = '', $defTitle = '', $defIconUrl = '', $defGroup = '', $defInlineLabel = '', $defVisitedIcon = '' ) { |
||
254 | |||
255 | } |
||
256 |
This method has been deprecated.