fixed string
This commit is contained in:
@@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
+3
-2
@@ -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'},
|
||||
|
||||
Reference in New Issue
Block a user