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 a590bc48
authored
Jan 22, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'change-map' into 'master'
上线合并 See merge request
!50
2 parents
47d8ab18
c2f62a00
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
src/utils/mapBgeo.js
src/utils/replay.js
src/utils/mapBgeo.js
View file @
a590bc4
...
@@ -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 @
a590bc4
...
@@ -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,7 @@ const replay = {
...
@@ -59,8 +60,7 @@ 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
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
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
),
...
@@ -80,7 +80,7 @@ const replay = {
...
@@ -80,7 +80,7 @@ const replay = {
let
item
=
replay
.
data
[
this
.
idx
]
let
item
=
replay
.
data
[
this
.
idx
]
AMap
.
invoke
(
'lushuSetContent'
,
replay
.
getNavgInfoContent
(
item
))
//设置信息窗口文案
AMap
.
invoke
(
'lushuSetContent'
,
replay
.
getNavgInfoContent
(
item
))
//设置信息窗口文案
EventBus
.
$emit
(
'uiMap.replay.currAddress'
,
''
);
EventBus
.
$emit
(
'uiMap.replay.currAddress'
,
''
);
if
(
this
.
idx
>=
replay
.
data
.
length
-
2
){
if
(
this
.
idx
>=
replay
.
data
.
length
-
3
){
EventBus
.
$emit
(
'uiMap.replay.done'
);
EventBus
.
$emit
(
'uiMap.replay.done'
);
}
}
});
});
...
@@ -126,7 +126,7 @@ const replay = {
...
@@ -126,7 +126,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 +147,7 @@ const replay = {
...
@@ -147,7 +147,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 +251,15 @@ const replay = {
...
@@ -251,13 +251,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