| Total Complexity | 4 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class ContinentRect{ |
||
| 14 | |||
| 15 | protected array $rect; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * ContinentRect constructor. |
||
| 19 | * |
||
| 20 | * @param array $continent_rect (NW/SE corners [[nw_x, nw_y],[se_x, se_y]]) |
||
| 21 | */ |
||
| 22 | public function __construct(array $continent_rect){ |
||
| 23 | $this->rect = $continent_rect; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * returns bounds for L.LatLngBounds() (NE/SW corners) |
||
| 28 | */ |
||
| 29 | public function getBounds():array{ |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * returns the center of the rectangle |
||
| 38 | */ |
||
| 39 | public function getCenter():array{ |
||
| 40 | return [ |
||
| 41 | ($this->rect[0][0] + $this->rect[1][0]) / 2, |
||
| 42 | ($this->rect[0][1] + $this->rect[1][1]) / 2, |
||
| 43 | ]; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * returns a polygon made of the rectangles corners |
||
| 48 | */ |
||
| 49 | public function getPoly():array{ |
||
| 55 | ]]; |
||
| 56 | } |
||
| 57 | |||
| 59 |