From 1bb848e34402e0aefb3006e9dec5fb75154f0438 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 15 Dec 2023 22:20:32 -0500 Subject: [PATCH] Update martin-tile-utils/src/lib.rs --- martin-tile-utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/martin-tile-utils/src/lib.rs b/martin-tile-utils/src/lib.rs index 5120a00d7..89067e8c9 100644 --- a/martin-tile-utils/src/lib.rs +++ b/martin-tile-utils/src/lib.rs @@ -262,7 +262,7 @@ pub fn webmercator_to_wgs84(x: f64, y: f64) -> (f64, f64) { pub fn wgs84_to_webmercator(lon: f64, lat: f64) -> (f64, f64) { let x = EARTH_CIRCUMFERENCE / 360.0 * lon; let y = ((90.0 + lat) * PI / 360.0).tan().ln() / (PI / 180.0); - let y = PI * 6_378_137.0 * y / 180.0; + let y = EARTH_CIRCUMFERENCE / 360.0 * y; (x, y) }