Browse Source

cleaner code: replace while() statements

pull/614/head
Peter Johnson 9 years ago
parent
commit
791052e259
  1. 10
      sanitiser/wrap.js

10
sanitiser/wrap.js

@ -34,14 +34,8 @@ function wrap( lat, lon ){
break;
}
// reduce lon
while( point.lon > 180 ){
point.lon -= 360;
}
// increase lon
while( point.lon < -180 ){
point.lon += 360;
if( point.lon > 180 || point.lon <= -180 ){
point.lon -= Math.floor(( point.lon + 180 ) / 360) * 360;
}
return point;

Loading…
Cancel
Save