Skip to content

Commit

Permalink
wkt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar Bansal committed Nov 20, 2022
1 parent 4020c0c commit dfa9fed
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
13 changes: 12 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "^6.4.3",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"wkt": "^0.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/pages/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rawdata from './data.json';
import ToolTipCircle from "../components/ToolTipCircle";
import Slider from "../components/slider";
import DatePicker from "react-datepicker";

import { stringify } from 'wkt';
import "react-datepicker/dist/react-datepicker.css";
const Start = () => {

Expand Down Expand Up @@ -80,6 +80,12 @@ const Start = () => {
rectangle.push([lat, lng]);
rectangle.push(rectangle[0]);
setRectangle(rectangle);
console.log(rectangle);
const str = stringify({
type: "Polygon",
coordinates: [rectangle]
})
console.log(str);
}
else if (rectangle.length < 4) {
rectangle.push([lat, lng]);
Expand Down

0 comments on commit dfa9fed

Please sign in to comment.