fixed the degreesToStringHDMS_() function to promote a seconds value of 60 up to the next minute

This commit is contained in:
alfred.jackson
2017-01-27 14:43:41 -06:00
parent 70d6bb72fb
commit 2001244b88
2 changed files with 22 additions and 7 deletions

View File

@@ -206,13 +206,13 @@ describe('ol.coordinate', function() {
it('formats with zero fractional digits as default', function() {
var coord = [7.85, 47.983333];
var got = ol.coordinate.toStringHDMS(coord);
var expected = '47° 58 60″ N 7° 50 60″ E';
var expected = '47° 59 00″ N 7° 51 00″ E';
expect(got).to.be(expected);
});
it('formats with given fractional digits, if passed', function() {
var coord = [7.85, 47.983333];
var coord = [7.85, 47.983201];
var got = ol.coordinate.toStringHDMS(coord, 3);
var expected = '47° 58 59.999″ N 7° 50 60.000″ E';
var expected = '47° 58 59.524″ N 7° 51 0.000″ E';
expect(got).to.be(expected);
});
});