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; break;
} }
// reduce lon if( point.lon > 180 || point.lon <= -180 ){
while( point.lon > 180 ){ point.lon -= Math.floor(( point.lon + 180 ) / 360) * 360;
point.lon -= 360;
}
// increase lon
while( point.lon < -180 ){
point.lon += 360;
} }
return point; return point;

Loading…
Cancel
Save