Skip to content

Commit

Permalink
fixed typo in calculating latitude band letter where would return und…
Browse files Browse the repository at this point in the history
…efined instead of Z when latitude is less than -80
  • Loading branch information
DanielJDufour committed Jul 11, 2019
1 parent 1780ee7 commit 257e4a1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mgrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ const I = 73; // I
const O = 79; // O
const V = 86; // V
const Z = 90; // Z
export default {
forward,
inverse,
toPoint
};


/**
* Conversion of lat/lon to MGRS.
Expand Down Expand Up @@ -297,11 +291,11 @@ function UTMtoLL(utm) {
* for.
* @return {char} The letter designator.
*/
function getLetterDesignator(latitude) {
export function getLetterDesignator(latitude) {
if (latitude <= 84 && latitude >= 72) {
// the X band is 12 degrees high
return 'X';
} else if (latitude < 72 || latitude >= -80) {
} else if (latitude < 72 && latitude >= -80) {
// Latitude bands are lettered C through X, excluding I and O
const bandLetters = 'CDEFGHJKLMNPQRSTUVWX';
const bandHeight = 8;
Expand Down

0 comments on commit 257e4a1

Please sign in to comment.