This commit is contained in:
zakhy 2025-03-05 10:35:29 +07:00
parent a4e54cc327
commit 9db91a6380

View File

@ -537,11 +537,9 @@
return entities.map(entity => {
const coords = getCoordinates(entity).map(([x, y]) => {
// Возможно отображение от нулевых координат. Для этого нужно отнимать minX и minY
const normalizedX = x
// - minX;
const normalizedY = y
// - minY;
return convertToLonLat([normalizedX, normalizedY]);
const XOffset = parseInt(document.getElementById("XOffsetField").value)
const YOffset = parseInt(document.getElementById("YOffsetField").value)
return convertToLonLat([x, y], XOffset, YOffset);
});
return {...entity, normalizedCoords: coords};
});
@ -701,13 +699,9 @@
}
}
function convertToLonLat([x, y]) {
const XOffset = parseInt(document.getElementById("XOffsetField").value)
const YOffset = parseInt(document.getElementById("YOffsetField").value)
if (XOffset && YOffset) {
y += XOffset // X попр
x += YOffset // Y попр
}
function convertToLonLat([x, y], XOffset = 0, YOffset = 0) {
y += XOffset // X попр
x += YOffset // Y попр
proj4.defs(
"EPSG:28415",
"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +towgs84=23.57,-140.95,-79.8,0,0.35,0.79,-0.22 +units=m +no_defs"