查看Android的GPS
Showing
1 changed file
with
1 additions
and
3 deletions
| ... | @@ -76,7 +76,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { | ... | @@ -76,7 +76,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { |
| 76 | var isRes = false | 76 | var isRes = false |
| 77 | if(this.isAndroid) { | 77 | if(this.isAndroid) { |
| 78 | var toNonExponential = function (num) { | 78 | var toNonExponential = function (num) { |
| 79 | var m = num.toExponential().match(/\d(?:\.(\d*))?E([+-]\d+)/); | 79 | var m = num.toExponential().match(/\d(?:\.(\d*))?e([+-]\d+)/); |
| 80 | return num.toFixed(Math.max(0, (m[1] || '').length - m[2])); | 80 | return num.toFixed(Math.max(0, (m[1] || '').length - m[2])); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| ... | @@ -92,8 +92,6 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { | ... | @@ -92,8 +92,6 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { |
| 92 | longitude = arr[1].split('=')[1] | 92 | longitude = arr[1].split('=')[1] |
| 93 | latitude = toNonExponential(latitude) | 93 | latitude = toNonExponential(latitude) |
| 94 | longitude = toNonExponential(longitude) | 94 | longitude = toNonExponential(longitude) |
| 95 | |||
| 96 | |||
| 97 | layer.open({ | 95 | layer.open({ |
| 98 | content: latitude | 96 | content: latitude |
| 99 | }) | 97 | }) | ... | ... |
-
Please register or sign in to post a comment