1a47b92d by ex

查看Android的GPS

1 parent d197998b
...@@ -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 })
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!