1 | <?php |
||
11 | class LineString |
||
12 | { |
||
13 | public const TYPE = 'LineString'; |
||
14 | |||
15 | /** |
||
16 | * @var float[][] |
||
17 | */ |
||
18 | private $coordinates; |
||
19 | |||
20 | /** |
||
21 | * Create a LineString object from coordinates |
||
22 | * |
||
23 | * The coordinates must be in Long-Lat order. Example: |
||
24 | * |
||
25 | * <code> |
||
26 | * |
||
27 | * LineString::from([10.1, 20.2, 10.2, 20.3]) |
||
28 | * |
||
29 | * </code> |
||
30 | * |
||
31 | * @param array $coordinates The coordinates as pairs of Long-Lat |
||
32 | * |
||
33 | * @return LineString |
||
34 | */ |
||
35 | 4 | public static function fromLngLats(array $coordinates) |
|
43 | |||
44 | /** |
||
45 | */ |
||
46 | 4 | protected function __construct() |
|
49 | |||
50 | /** |
||
51 | * @return \float[][] |
||
52 | */ |
||
53 | 2 | public function getCoordinates() |
|
57 | } |
||
58 |