Fixed first point not being pushed to the end of the array properly
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ module.exports = {
|
||||
if (distance < 20) {
|
||||
if (lastPoint.lat != firstPoint.lat || lastPoint.lng != firstPoint.lng) {
|
||||
// points.pop();
|
||||
points.push({lat: firstPoint.lat, lng: lastPoint.lng});
|
||||
points.push({lat: firstPoint.lat, lng: firstPoint.lng});
|
||||
}
|
||||
areaFunctions.collatePolygons(res, gameID, userID, points);
|
||||
} else {
|
||||
|
||||
@@ -85,7 +85,7 @@ module.exports = {
|
||||
let polygonResult = [];
|
||||
let polygonsMerged = [];
|
||||
polygons.map((polygon) => {
|
||||
if (polygon.coords[0].lat != polygon.coords[polygon.coords.length - 1].lat &&
|
||||
if (polygon.coords[0].lat != polygon.coords[polygon.coords.length - 1].lat ||
|
||||
polygon.coords[0].lng != polygon.coords[polygon.coords.length - 1].lng) {
|
||||
polygon.coords.push({lat: polygon.coords[0].lat, lng: polygon.coords[0].lng})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user