From 0b5b038ec5433ad9e31affa1788f14dfcd5cc989 Mon Sep 17 00:00:00 2001 From: Kleinc Date: Mon, 6 Oct 2025 10:59:54 +0200 Subject: [PATCH] refactor(#10): Added more decimals to lat/lon and elevation target Added more decimals to lat/lon and elevation target for more precission --- src/coordinateShowing/coordinateShowing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coordinateShowing/coordinateShowing.js b/src/coordinateShowing/coordinateShowing.js index 8ec2d6a..941afb3 100644 --- a/src/coordinateShowing/coordinateShowing.js +++ b/src/coordinateShowing/coordinateShowing.js @@ -52,7 +52,7 @@ function drawText(ctx, text, canvas) { export function updatePosition() { const cam = window.viewer.scene.view.position; const [lon, lat] = proj4(ecef, wgs84, [cam.x, cam.y, cam.z]); - drawText(posCtx, `lat = ${lat.toFixed(2)}˚ lon = ${lon.toFixed(2)}˚`, posCanvas); + drawText(posCtx, `lat = ${lat.toFixed(5)}˚ lon = ${lon.toFixed(5)}˚`, posCanvas); } /** @@ -65,7 +65,7 @@ export function updateTargetElevation() { if (controls === window.viewer.orbitControls) { elevationCanvas.style.display = 'inline'; - drawText(elevationCtx, `Target elevation = ${height.toFixed(2)}m`, elevationCanvas); + drawText(elevationCtx, `Target elevation = ${height.toFixed(4)}m`, elevationCanvas); } else { elevationCanvas.style.display = 'none'; }