earth radius: change leaflet and leaflet-draw to use the radius value used by the s2 geometry library

this library is used in the ingress backend, so distance calculation, etc are far closer if we use the value from that
This commit is contained in:
Jon Atkins
2015-03-12 20:47:05 +00:00
parent 1dae89b4bc
commit 522ef34f77
3 changed files with 6 additions and 6 deletions

View File

@ -1602,7 +1602,7 @@ L.GeometryUtil = {
area += ((p2.lng - p1.lng) * d2r) *
(2 + Math.sin(p1.lat * d2r) + Math.sin(p2.lat * d2r));
}
area = area * 6378137.0 * 6378137.0 / 2.0;
area = area * 6367000.0 * 6367000.0 / 2.0;
}
return Math.abs(area);