Die Verwechslung von Breiten- und Längengrad in Ihrer Funktion updateGisLines.js beim Aktualisieren eines Markers innerhalb einer Linie in Ihrer Datenbank weist typischerweise auf ein häufiges Problem bei der Handhabung von Geokoordinaten hin.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// /pages/api/talas_v5_DB/gisLines/updateGisLines.js
|
||||
import mysql from "mysql";
|
||||
|
||||
const dbConfig = {
|
||||
@@ -23,7 +24,7 @@ export default function handler(req, res) {
|
||||
}
|
||||
|
||||
const { idModul, newCoordinates } = req.body;
|
||||
const newLineString = `LINESTRING(${newCoordinates.map((coord) => `${coord[1]} ${coord[0]}`).join(",")})`;
|
||||
const newLineString = `LINESTRING(${newCoordinates.map((coord) => `${coord[0]} ${coord[1]}`).join(",")})`;
|
||||
|
||||
const query =
|
||||
"UPDATE talas_v5.gis_lines SET points = ST_GeomFromText(?) WHERE idModul = ?;";
|
||||
|
||||
Reference in New Issue
Block a user