mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-26 01:47:49 +02:00
Fix buggy padByMeters (PI/180 is needed here)
This commit is contained in:
+2
-2
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user