Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6c266ae8
authored
Jan 20, 2025
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
轨迹修复
1 parent
94b2ffb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
src/utils/mapBgeo.js
src/utils/replay.js
src/utils/mapBgeo.js
View file @
6c266ae
...
@@ -83,7 +83,6 @@ const MAPGEO = {
...
@@ -83,7 +83,6 @@ const MAPGEO = {
setAddress
(
o
,
res
);
setAddress
(
o
,
res
);
obj
.
totalNum
++
;
obj
.
totalNum
++
;
if
(
obj
.
totalNum
===
obj
.
realNum
)
{
if
(
obj
.
totalNum
===
obj
.
realNum
)
{
console
.
log
(
'geocoderGetAdr'
,
data
)
cb
&&
cb
(
data
)
cb
&&
cb
(
data
)
}
}
})
})
...
...
src/utils/replay.js
View file @
6c266ae
...
@@ -46,6 +46,7 @@ const replay = {
...
@@ -46,6 +46,7 @@ const replay = {
replayData
.
push
(
lnglat
)
replayData
.
push
(
lnglat
)
return
item
return
item
});
});
let
p1
=
replayData
[
0
];
let
p1
=
replayData
[
0
];
let
p2
=
replayData
[
replayData
.
length
-
1
];
let
p2
=
replayData
[
replayData
.
length
-
1
];
let
line
=
AMap
.
invoke
(
'Polyline'
,
replayData
,
{
strokeColor
:
'#0b94db'
,
strokeWeight
:
6
})
let
line
=
AMap
.
invoke
(
'Polyline'
,
replayData
,
{
strokeColor
:
'#0b94db'
,
strokeWeight
:
6
})
...
@@ -59,8 +60,8 @@ const replay = {
...
@@ -59,8 +60,8 @@ const replay = {
replay
.
distance
=
replay
.
dis
.
reduce
(
function
(
prev
,
cur
,
index
,
arr
)
{
replay
.
distance
=
replay
.
dis
.
reduce
(
function
(
prev
,
cur
,
index
,
arr
)
{
return
prev
+
cur
;
return
prev
+
cur
;
});
});
//
replay.distance= parseInt(replay.distance/1000)//算出轨迹的距离(km)
replay
.
distance
=
parseInt
(
replay
.
distance
/
1000
)
//算出轨迹的距离(km)
console
.
log
(
replay
.
distance
,
replay
.
getSpeed
(
replay
.
speed
,
replay
.
distance
))
const
firstItem
=
replay
.
data
[
0
];
const
firstItem
=
replay
.
data
[
0
];
replay
.
navg
=
AMap
.
invoke
(
'LuShu'
,
replayData
,
{
replay
.
navg
=
AMap
.
invoke
(
'LuShu'
,
replayData
,
{
defaultContent
:
replay
.
getNavgInfoContent
(
firstItem
),
defaultContent
:
replay
.
getNavgInfoContent
(
firstItem
),
...
@@ -126,7 +127,7 @@ const replay = {
...
@@ -126,7 +127,7 @@ const replay = {
//显示轨迹
//显示轨迹
EventBus
.
$on
(
'uiMap.replay.init'
,
function
(
data
,
speed
){
EventBus
.
$on
(
'uiMap.replay.init'
,
function
(
data
,
speed
){
replay
.
destroy
();
replay
.
destroy
();
replay
.
data
=
data
;
replay
.
data
=
data
if
(
speed
||
speed
===
0
){
if
(
speed
||
speed
===
0
){
replay
.
speed
=
speed
;
replay
.
speed
=
speed
;
}
}
...
@@ -147,7 +148,7 @@ const replay = {
...
@@ -147,7 +148,7 @@ const replay = {
//轨迹暂停
//轨迹暂停
EventBus
.
$on
(
'uiMap.replay.pause'
,
(
ifShowAddr
)
=>
{
EventBus
.
$on
(
'uiMap.replay.pause'
,
(
ifShowAddr
)
=>
{
console
.
log
(
this
.
idx
)
if
(
replay
.
navg
){
if
(
replay
.
navg
){
AMap
.
invoke
(
'lushuPause'
)
AMap
.
invoke
(
'lushuPause'
)
if
(
ifShowAddr
){
if
(
ifShowAddr
){
...
@@ -251,13 +252,15 @@ const replay = {
...
@@ -251,13 +252,15 @@ const replay = {
// },
// },
speedEvent
(
idx
,
dis
)
{
speedEvent
(
idx
,
dis
)
{
let
timeArr
=
[[
40
,
30
,
16
],
[
30
,
20
,
12
],
[
20
,
12
,
8
],
[
5
,
3
,
2
]]
// 慢 正常 快 很快
let
timeArr
=
[[
40
,
30
,
16
],
[
30
,
20
,
12
],
[
20
,
12
,
8
],
[
5
,
3
,
2
]]
// 慢 正常 快 很快
let
speed
let
speed
;
let
disM
=
dis
*
1000
if
(
dis
>=
100
)
{
// 100公里以上
if
(
dis
>=
100
)
{
// 100公里以上
speed
=
Math
.
floor
((
dis
/
timeArr
[
idx
][
0
]))
speed
=
Math
.
floor
((
dis
M
/
timeArr
[
idx
][
0
]))
}
else
if
(
dis
>
10
&&
dis
<
100
)
{
// 10-100公里
}
else
if
(
dis
>
10
&&
dis
<
100
)
{
// 10-100公里
speed
=
Math
.
floor
((
dis
/
timeArr
[
idx
][
1
]))
speed
=
Math
.
floor
((
dis
M
/
timeArr
[
idx
][
1
]))
}
else
{
// 10公里以内
}
else
{
// 10公里以内
speed
=
Math
.
floor
((
dis
/
timeArr
[
idx
][
2
]))
speed
=
Math
.
floor
((
dis
M
/
timeArr
[
idx
][
2
]))
}
}
return
speed
return
speed
},
},
...
...
Write
Preview
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