src/Location/Polygon.php 1 location
|
@@ 114-117 (lines=4) @@
|
| 111 |
|
|
| 112 |
|
$previousPoint = reset($this->points); |
| 113 |
|
|
| 114 |
|
while ($point = next($this->points)) { |
| 115 |
|
$segments[] = new Line($previousPoint, $point); |
| 116 |
|
$previousPoint = $point; |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
// to close the polygon we have to add the final segment between |
| 120 |
|
// the last point and the first point |
src/Location/Polyline.php 1 location
|
@@ 80-83 (lines=4) @@
|
| 77 |
|
|
| 78 |
|
$previousPoint = reset($this->points); |
| 79 |
|
|
| 80 |
|
while ($point = next($this->points)) { |
| 81 |
|
$segments[] = new Line($previousPoint, $point); |
| 82 |
|
$previousPoint = $point; |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
return $segments; |
| 86 |
|
} |