Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
e-shield-h5
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 8a11cf06
authored
Apr 21, 2025
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
多个点一致,标记点
1 parent
91331fba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
38 deletions
src/views/replay.vue
src/views/replay.vue
View file @
8a11cf0
...
@@ -342,7 +342,7 @@ export default defineComponent({
...
@@ -342,7 +342,7 @@ export default defineComponent({
// replayData.push(lnglat);
// replayData.push(lnglat);
// });
// });
data
.
reduce
(
function
(
prev
,
item
){
data
.
reduce
(
function
(
prev
,
item
){
console
.
log
(
prev
,
item
)
//
console.log(prev ,item)
let
prevLnglat
=
mapContentRefs
.
value
.
getLngLat
(
prev
[
0
],
prev
[
1
])
let
prevLnglat
=
mapContentRefs
.
value
.
getLngLat
(
prev
[
0
],
prev
[
1
])
let
lnglat
=
mapContentRefs
.
value
.
getLngLat
(
item
[
0
],
item
[
1
])
let
lnglat
=
mapContentRefs
.
value
.
getLngLat
(
item
[
0
],
item
[
1
])
replay
.
dis
.
push
(
window
.
mapapi
.
invoke
(
"getDistance"
,
prevLnglat
,
lnglat
))
replay
.
dis
.
push
(
window
.
mapapi
.
invoke
(
"getDistance"
,
prevLnglat
,
lnglat
))
...
@@ -365,44 +365,55 @@ export default defineComponent({
...
@@ -365,44 +365,55 @@ export default defineComponent({
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
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
if
(
replay
.
distance
){
const
firstItem
=
data
[
0
];
replay
.
distance
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
replay
.
navg
=
window
.
mapapi
.
invoke
(
"LuShu"
,
replayData
,
{
const
firstItem
=
data
[
0
];
// defaultContent: getNavgInfoContent(firstItem),
replay
.
navg
=
window
.
mapapi
.
invoke
(
"LuShu"
,
replayData
,
{
autoView
:
true
,
// 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
// defaultContent: getNavgInfoContent(firstItem),
speed
:
getSpeed
(
replay
.
speed
,
replay
.
distance
),
autoView
:
true
,
// 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
// speed: 300,
speed
:
getSpeed
(
replay
.
speed
,
replay
.
distance
),
icon
:
window
.
mapapi
.
invoke
(
// speed: 300,
"Icon"
,
icon
:
window
.
mapapi
.
invoke
(
require
(
"@/assets/images/car0.png"
),
"Icon"
,
window
.
mapapi
.
invoke
(
"Size"
,
26
,
17
),
require
(
"@/assets/images/car0.png"
),
// { anchor: window.mapapi.invoke("Size", 24, 24) }
window
.
mapapi
.
invoke
(
"Size"
,
26
,
17
),
),
// { anchor: window.mapapi.invoke("Size", 24, 24) }
enableRotation
:
true
,
// 是否设置marker随着道路的走向进行旋转
),
});
enableRotation
:
true
,
// 是否设置marker随着道路的走向进行旋转
// window.mapapi.invoke("lushuStart"); //开始
});
// AMap.invoke('lushuStop') //停止
// window.mapapi.invoke("lushuStart"); //开始
// AMap.invoke('lushuPause') //暂停
// AMap.invoke('lushuStop') //停止
// AMap.invoke('lushuShowInfoWindow') //打开信息窗口
// AMap.invoke('lushuPause') //暂停
// EventBus.$emit("uiMap.replay.initDone");
// AMap.invoke('lushuShowInfoWindow') //打开信息窗口
window
.
mapapi
.
invoke
(
"lushuAddEventListener"
,
"move"
,
(
e
)
=>
{
// EventBus.$emit("uiMap.replay.initDone");
if
(
e
.
target
.
i
){
window
.
mapapi
.
invoke
(
"lushuAddEventListener"
,
"move"
,
(
e
)
=>
{
idx
.
value
=
e
.
target
.
i
if
(
e
.
target
.
i
){
}
idx
.
value
=
e
.
target
.
i
}
// let lnglat = replayData[idx.value];
// let item = data[idx.value];
// let lnglat = replayData[idx.value];
// window.mapapi.invoke("lushuSetContent", replay.getNavgInfoContent(item)); //设置信息窗口文案
// let item = data[idx.value];
// EventBus.$emit("uiMap.replay.currAddress", "");
// window.mapapi.invoke("lushuSetContent", replay.getNavgInfoContent(item)); //设置信息窗口文案
// console.log(idx.value, data.length - 1);
// EventBus.$emit("uiMap.replay.currAddress", "");
// if (idx.value >= data.length - 2) {
// console.log(idx.value, data.length - 1);
// EventBus.$emit("uiMap.replay.done");
// if (idx.value >= data.length - 2) {
// }
// EventBus.$emit("uiMap.replay.done");
});
// }
});
window
.
mapapi
.
invoke
(
"lushuAddEventListener"
,
"end"
,
(
e
)
=>
{
window
.
mapapi
.
invoke
(
"lushuAddEventListener"
,
"end"
,
(
e
)
=>
{
isPlay
.
value
=
false
;
isPlay
.
value
=
false
;
})
})
}
else
{
//距离为0时,单独处理
const
item
=
data
[
data
.
length
-
1
];
window
.
mapapi
.
invoke
(
'clearOverlays'
);
// replay.Marker = mapService.createCarMarker(p2, window.mapapi);
let
marker
=
window
.
mapapi
.
invoke
(
'Marker'
,
p2
,
{
icon
:
window
.
mapapi
.
invoke
(
'Icon'
,
require
(
"@/assets/images/curr-marker.gif"
),
window
.
mapapi
.
invoke
(
'Size'
,
24
,
24
)),
})
window
.
mapapi
.
invoke
(
'addOverlay'
,
marker
)
}
// replay.dis = window.AMap.GeometryUtil.distanceOfLine(replayData) / 1000; // 算出轨迹的距离(km)
// replay.dis = window.AMap.GeometryUtil.distanceOfLine(replayData) / 1000; // 算出轨迹的距离(km)
// if (replay.PathS) {
// if (replay.PathS) {
...
...
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