diff --git a/api/v1/api.js b/api/v1/api.js index bff6145..2a0e25b 100644 --- a/api/v1/api.js +++ b/api/v1/api.js @@ -48,7 +48,7 @@ module.exports = { let lastPoint = points[points.length - 1]; let distance = mathFunc.gpsToMeters(firstPoint.lat, firstPoint.lng, lastPoint.lat, lastPoint.lng); console.log(distance); - if (distance < 10) { + if (distance < 20) { if (lastPoint.lat != firstPoint.lat && lastPoint.lng != firstPoint.lng) { // points.pop(); points.push({lat: firstPoint.lat, lng: lastPoint.lng}); diff --git a/api/v1/areaFunctions.js b/api/v1/areaFunctions.js index ba40277..3336f9e 100644 --- a/api/v1/areaFunctions.js +++ b/api/v1/areaFunctions.js @@ -25,7 +25,8 @@ module.exports = { return polygons }, submitFinalCollation(res, gameID, userID, points, area, mergedPolygonIDs) { - query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area); + let query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area); + console.log(query); db.get().query(query, function(err, rows) { if (err) { console.log(err); @@ -85,6 +86,7 @@ module.exports = { let polygonResult = []; let polygonsMerged = []; polygons.map((polygon) => { + console.log(polygon); if (polygon[0].lat != polygon[polygon.length - 1].lat && polygon[0].lng != polygon[polygon.length - 1].lng) { polygon.push({lat: polygon[0].lat, lng: polygon[0].lng})