... | ... |
@@ -94,8 +94,8 @@ var buttonsClass = { |
94 | 94 |
var level_min = 13; |
95 | 95 |
var level_max = 7; |
96 | 96 |
var range_from_level = func (l) { |
97 |
- var r = (me.device.display.display.get('view[1]') / 2 * 84.53 * math.cos(data.lat) / math.pow(2, l)) * units.distance.from_nm; |
|
98 |
- return sprintf('% 3u%s', math.round(r, r > 10 ? 5 : 1), units.distance.from_nm == 1 ? 'NM' : 'km'); |
|
97 |
+ var r = (me.device.display.display.get('view[1]') / 2 * 84.53 * math.cos(data.lat * D2R) / math.pow(2, l)) * units.distance.from_nm; |
|
98 |
+ return sprintf('% 3i%s', math.round(r, r > 10 ? 5 : 1), units.distance.from_nm == 1 ? 'NM' : 'km'); |
|
99 | 99 |
} |
100 | 100 |
var ranges = [ sprintf(' %s >', range_from_level(level_max)) ]; |
101 | 101 |
for (var i = level_max + 1; i <= level_min; i += 1) |