From c316f87c6f714db9321f56f39016af5c9c095765 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 20 Jun 2014 18:01:53 -0400 Subject: [PATCH] Fix buggy padByMeters (PI/180 is needed here) --- js/id/geo/extent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/id/geo/extent.js b/js/id/geo/extent.js index 2081f82c2..9fd659f5e 100644 --- a/js/id/geo/extent.js +++ b/js/id/geo/extent.js @@ -58,8 +58,8 @@ _.extend(iD.geo.Extent.prototype, { }, padByMeters: function(meters) { - var dLat = meters / 111200, - dLon = meters / 111200 / Math.abs(Math.cos(this.center()[1])); + var dLat = meters / 111132.954, + dLon = meters / 111132.954 / Math.abs(Math.cos(this.center()[1] * (Math.PI / 180))); return iD.geo.Extent( [this[0][0] - dLon, this[0][1] - dLat], [this[1][0] + dLon, this[1][1] + dLat]);