diff --git a/api/v1/areaFunctions.js b/api/v1/areaFunctions.js index 3ee54c0..837d33d 100644 --- a/api/v1/areaFunctions.js +++ b/api/v1/areaFunctions.js @@ -95,7 +95,7 @@ module.exports = { }); let area = mathFunc.calculateArea(points); - module.exports.polygonDestruction(res, gameID, userID, polygonPoints, area, polygonsMerged); + // module.exports.polygonDestruction(res, gameID, userID, polygonPoints, area, polygonsMerged); module.exports.submitFinalCollation(res, gameID, userID, polygonPoints, area, polygonsMerged); }); }, diff --git a/update-map.js b/update-map.js index 92cc32f..63a5d42 100644 --- a/update-map.js +++ b/update-map.js @@ -2,16 +2,17 @@ const config = require("./config.json"); import CapturedArea from "./components/captured-area"; export const sendArea = (gameID, username, polygon) => { - console.log(polygon) + // console.log(polygon) points = [] polygon.map((point) => { - points.push({lat: point.coordinate.latitude, lon: point.coordinate.longitude}) + points.push({lat: point.coordinate.latitude, lng: point.coordinate.longitude}) }) let formBody = []; formBody.push("gameID=" + gameID); formBody.push("userID=" + username); formBody.push("points=" + JSON.stringify(points)); formBody = formBody.join("&"); + console.log(formBody) fetch("http://"+config.host + ":" + config.port + "/v1/polygon", { method: "post", headers: {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'},