1 | <?php |
||
5 | class Element |
||
6 | { |
||
7 | const MAX_ABS_LATITUDE = 90.0; |
||
8 | const MAX_ABS_LONGITUDE = 180.0; |
||
9 | const ABS_LATITUDE_LIMIT = 89.9999; |
||
10 | const ABS_LONGITUDE_LIMIT = 179.9999; |
||
11 | const LEVEL_A = 'a'; |
||
12 | const LEVEL_B = 'b'; |
||
13 | const LEVEL_C = 'c'; |
||
14 | const LEVEL_D = 'd'; |
||
15 | |||
16 | protected $top; |
||
17 | protected $bottom; |
||
18 | protected $left; |
||
19 | protected $right; |
||
20 | protected $midLat; |
||
21 | protected $midLon; |
||
22 | protected $level; |
||
23 | |||
24 | /** |
||
25 | * Element constructor. |
||
26 | */ |
||
27 | 25 | public function __construct() |
|
37 | |||
38 | /** |
||
39 | * Move the current quadrant to a particular location (latitude, longitude) |
||
40 | * @param $latitude |
||
41 | * @param $longitude |
||
42 | */ |
||
43 | 17 | public function moveToNextQuadrant($latitude, $longitude) |
|
64 | |||
65 | /** |
||
66 | * Update the mid coordinates attributes of the quadrant |
||
67 | */ |
||
68 | 17 | public function updateMidCoordinates() |
|
73 | |||
74 | /** |
||
75 | * Get the quadrant level (a, b, c or d) |
||
76 | * @return string |
||
77 | */ |
||
78 | 17 | public function getLevel() |
|
82 | } |
||
83 |