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