Fix buggy padByMeters (PI/180 is needed here)

This commit is contained in:
Bryan Housel
2014-06-20 18:01:53 -04:00
parent d342e01326
commit c316f87c6f
+2 -2
View File
@@ -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]);