Browse files

Fix erroneous bbox test for 180 meridian (e.g. AK)

  • Loading branch information...
1 parent b542541 commit 20789390ea125127eda537b962edab28947a5787 @geary committed Oct 10, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 code/polygonzo.js
View
6 code/polygonzo.js
@@ -334,12 +334,14 @@ PolyGonzo = {
];
}
else {
+ var w = bbox[0], e = bbox[2];
+ if( w > e ) w -= 360;
var s1 = sin( bbox[1] * pi180 );
var s3 = sin( bbox[3] * pi180 );
box = [
- featureOffsetX + multX * bbox[0],
+ featureOffsetX + multX * w,
featureOffsetY + multY * log( (1+s1) / (1-s1) ),
- featureOffsetX + multX * bbox[2],
+ featureOffsetX + multX * e,
featureOffsetY + multY * log( (1+s3) / (1-s3) )
];
}

0 comments on commit 2078939

Please sign in to comment.