DebasishDhal99 commited on
Commit
efcf6f0
·
1 Parent(s): 2f322ce

Remove (lat, lon) mapping to itself

Browse files

Earlier I was mapping (lat, lon) to (lon, lat), which caused horrible errors.
Fixed it, but kept the mapping. i.e. (lat, lon) to (lat, lon) as to have a checkpoint of my error, removing it now to avoid unnecessary computation. More of a dummy commit.

Files changed (1) hide show
  1. frontend/src/components/Map.js +1 -1
frontend/src/components/Map.js CHANGED
@@ -276,7 +276,7 @@ const Map = ( { onMapClick, searchQuery, contentType } ) => {
276
  if (geoToolMode === "area" && areaPoints.length >= 3) {
277
  // Just ensuring that the polygon is closed (first == last)
278
  const closed = [...areaPoints, areaPoints[0]];
279
- const area = calculatePolygonArea(closed.map(([lat, lon]) => [lat, lon])); // This took me a while to figure out, it should be just (lat, lon), not (lon, lat)
280
  setPolygonArea(area);
281
  } else {
282
  setPolygonArea(null);
 
276
  if (geoToolMode === "area" && areaPoints.length >= 3) {
277
  // Just ensuring that the polygon is closed (first == last)
278
  const closed = [...areaPoints, areaPoints[0]];
279
+ const area = calculatePolygonArea(closed); // This took me a while to figure out, it should be just (lat, lon), not (lon, lat)
280
  setPolygonArea(area);
281
  } else {
282
  setPolygonArea(null);