Skip to content

Commit

Permalink
data/map.htm: handle 180 < x < 360 in map MBR
Browse files Browse the repository at this point in the history
The fix for #327 didn't switch longitudes for the MBR when the values
are 180 < x < 360.  Our services require -180 < x < 180.

Fixes #327
  • Loading branch information
ksshannon authored and nwagenbrenner committed Apr 15, 2019
1 parent 6064597 commit a5c9a90
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/map.htm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@
if(b._northEast.lng < -180) {
b._northEast.lng += 360;
}
// switch to negative longitudes if needed
if(b._southWest.lng > 180){
b._southWest.lng -= 360;
}
if(b._northEast.lng > 180){
b._northEast.lng -= 360;
}
return [b._southWest.lng, b._northEast.lng, b._southWest.lat, b._northEast.lat];
}
return null;
Expand Down

0 comments on commit a5c9a90

Please sign in to comment.