Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
dy-wx2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1a47b92d
authored
2019-01-31 10:03:37 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
查看Android的GPS
1 parent
d197998b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
js/JSBridge.js
js/JSBridge.js
View file @
1a47b92
...
...
@@ -76,7 +76,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
var
isRes
=
false
if
(
this
.
isAndroid
)
{
var
toNonExponential
=
function
(
num
)
{
var
m
=
num
.
toExponential
().
match
(
/
\d(?:\.(\d
*
))?
E
([
+-
]\d
+
)
/
);
var
m
=
num
.
toExponential
().
match
(
/
\d(?:\.(\d
*
))?
e
([
+-
]\d
+
)
/
);
return
num
.
toFixed
(
Math
.
max
(
0
,
(
m
[
1
]
||
''
).
length
-
m
[
2
]));
}
...
...
@@ -92,8 +92,6 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
latitude
=
toNonExponential
(
latitude
)
longitude
=
toNonExponential
(
longitude
)
layer
.
open
({
content
:
latitude
})
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment