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
5cf7468e
authored
2018-09-08 17:17:03 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
无法获取定位提示
1 parent
35e987e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
15 deletions
js/JSBridge.js
js/controller/mapController.js
js/JSBridge.js
View file @
5cf7468
...
...
@@ -57,10 +57,36 @@ AppClient.prototype.getERCode = function (jsonStr, callback) {
window
.
WebViewJavascriptBridge
.
callHandler
(
'getERCode'
,
jsonStr
);
window
.
WebViewJavascriptBridge
.
registerHandler
(
'postERCode'
,
callback
);
}
else
{
this
.
appObj
.
registerHandler
(
"postERCOde"
,
callback
)
var
isRes
=
false
this
.
appObj
.
registerHandler
(
"postERCOde"
,
function
(
data
,
responseCallback
)
{
isRes
=
true
var
latitude
=
''
var
longitude
=
''
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
data
);
var
arr
=
result
[
1
].
split
(
','
)
if
(
isAndroid
){
latitude
=
arr
[
0
].
split
(
'='
)[
1
]
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
}
else
{
latitude
=
arr
[
0
].
split
(
':'
)[
1
]
longitude
=
arr
[
1
].
split
(
':'
)[
1
]
}
callback
(
latitude
,
longitude
,
responseCallback
)
})
this
.
appObj
.
callHandler
(
"getERCode"
,
param
,
function
(
data
,
responseCallback
)
{
});
setTimeout
(
function
()
{
if
(
!
isRes
){
layer
.
open
({
content
:
'无法获取定位信息,检查定位设置,或重新开发'
})
callback
(
30.2741500000
,
120.1551500000
,
function
(){})
}
},
3000
)
}
};
AppClient
.
prototype
.
getGPS
=
function
(
jsonStr
,
callback
)
{
...
...
js/controller/mapController.js
View file @
5cf7468
...
...
@@ -302,20 +302,7 @@ angular.module('myApp')
$rootScope
.
isLoadFinish
=
true
},
1000
)
}
else
{
appClient
.
getGPS
(
''
,
function
(
data
,
cb
)
{
var
latitude
=
''
var
longitude
=
''
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
data
);
var
arr
=
result
[
1
].
split
(
','
)
if
(
isAndroid
){
latitude
=
arr
[
0
].
split
(
'='
)[
1
]
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
}
else
{
latitude
=
arr
[
0
].
split
(
':'
)[
1
]
longitude
=
arr
[
1
].
split
(
':'
)[
1
]
}
appClient
.
getGPS
(
''
,
function
(
latitude
,
longitude
,
cb
)
{
onSuccess
({
latitude
:
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