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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 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,6 +365,7 @@ export default defineComponent({
...
@@ -365,6 +365,7 @@ 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
;
});
});
if
(
replay
.
distance
){
replay
.
distance
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
replay
.
distance
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
const
firstItem
=
data
[
0
];
const
firstItem
=
data
[
0
];
replay
.
navg
=
window
.
mapapi
.
invoke
(
"LuShu"
,
replayData
,
{
replay
.
navg
=
window
.
mapapi
.
invoke
(
"LuShu"
,
replayData
,
{
...
@@ -403,6 +404,16 @@ export default defineComponent({
...
@@ -403,6 +404,16 @@ export default defineComponent({
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