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
ee4d6441
authored
2019-01-10 22:09:48 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加提示
1 parent
b2b4f299
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
js/JSBridge.js
js/controller/mapController.js
js/JSBridge.js
View file @
ee4d644
...
...
@@ -79,7 +79,8 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
isRes
=
true
var
latitude
=
''
var
longitude
=
''
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
data
);
var
str
=
JSON
.
stringify
(
data
)
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
str
);
var
arr
=
result
[
1
].
split
(
','
)
latitude
=
arr
[
0
].
split
(
'='
)[
1
]
longitude
=
arr
[
1
].
split
(
'='
)[
1
]
...
...
@@ -92,16 +93,11 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
var
latitude
=
''
var
longitude
=
''
var
str
=
JSON
.
stringify
(
data
)
try
{
var
result
=
/
\{([\s\S]
*
)\}
/
.
exec
(
str
);
var
arr
=
result
[
1
].
split
(
','
)
longitude
=
arr
[
0
].
split
(
':'
)[
1
]
latitude
=
arr
[
1
].
split
(
':'
)[
1
]
}
catch
(
e
)
{
layer
.
open
({
content
:
e
})
}
callback
(
latitude
,
longitude
,
responseCallback
)
...
...
js/controller/mapController.js
View file @
ee4d644
...
...
@@ -214,7 +214,11 @@ angular.module('myApp')
relocateControl
.
appendChild
(
relocateControlContent
);
relocateControl
.
onclick
=
function
()
{
map
.
panTo
(
myMarker
.
position
);
// map.panTo(myMarker.position);
layer
.
open
({
content
:
'正在定位'
})
initLocation
()
map
.
setZoom
(
15
);
}
map
.
getContainer
().
appendChild
(
relocateControl
);
...
...
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