Spaces:
Runtime error
Runtime error
Commit
·
efcf6f0
1
Parent(s):
2f322ce
Remove (lat, lon) mapping to itself
Browse filesEarlier 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.
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
|
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);
|