Skip to content

Commit 67b9911

Browse files
authored
Update openlocationcode.js
1 parent 91880c0 commit 67b9911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/src/openlocationcode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@
406406
}
407407

408408
// How many degrees longitude is the code from the reference?
409-
if (codeArea.longitudeCenter - referenceLongitude > halfResolution) {
409+
if (referenceLongitude + halfResolution < codeArea.longitudeCenter) {
410410
codeArea.longitudeCenter -= resolution;
411-
} else if (referenceLongitude - codeArea.longitudeCenter > halfResolution) {
411+
} else if (referenceLongitude - halfResolution > codeArea.longitudeCenter) {
412412
codeArea.longitudeCenter += resolution;
413413
}
414414

0 commit comments

Comments
 (0)