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 (distance < 20) {
|
||||||
if (lastPoint.lat != firstPoint.lat || lastPoint.lng != firstPoint.lng) {
|
if (lastPoint.lat != firstPoint.lat || lastPoint.lng != firstPoint.lng) {
|
||||||
// points.pop();
|
// points.pop();
|
||||||
points.push({lat: firstPoint.lat, lng: lastPoint.lng});
|
points.push({lat: firstPoint.lat, lng: firstPoint.lng});
|
||||||
}
|
}
|
||||||
areaFunctions.collatePolygons(res, gameID, userID, points);
|
areaFunctions.collatePolygons(res, gameID, userID, points);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ module.exports = {
|
|||||||
let polygonResult = [];
|
let polygonResult = [];
|
||||||
let polygonsMerged = [];
|
let polygonsMerged = [];
|
||||||
polygons.map((polygon) => {
|
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[0].lng != polygon.coords[polygon.coords.length - 1].lng) {
|
||||||
polygon.coords.push({lat: polygon.coords[0].lat, lng: polygon.coords[0].lng})
|
polygon.coords.push({lat: polygon.coords[0].lat, lng: polygon.coords[0].lng})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user