Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function format(Polyline $polyline): string |
||
22 | { |
||
23 | $points = []; |
||
24 | |||
25 | foreach ($polyline->getPoints() as $point) { |
||
26 | $points[] = [$point->getLng(), $point->getLat()]; |
||
27 | } |
||
28 | |||
29 | return json_encode( |
||
30 | [ |
||
31 | 'type' => 'LineString', |
||
32 | 'coordinates' => $points, |
||
33 | ] |
||
34 | ); |
||
35 | } |
||
36 | } |
||
37 |