Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
卡
卡车调度系统
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caicaicai
卡车调度系统
Commits
6a6c31e5
Commit
6a6c31e5
authored
Nov 17, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改轨迹展示效果
parent
2ecbbf34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
14 deletions
+76
-14
common.js
src/assets/js/common.js
+8
-0
Map2.vue
src/components/mars3d/Map2.vue
+68
-14
No files found.
src/assets/js/common.js
View file @
6a6c31e5
...
...
@@ -2584,6 +2584,14 @@ var HttpReq = function(){
params
:
param
,
})
},
//获取轨迹分段时间以及坐标
apimineAlarmHistoryTjQuery
:
function
(
param
){
return
request
({
url
:
'
/api/mineAlarmHistory/Tj
'
,
method
:
'
get
'
,
params
:
param
,
})
},
...
...
src/components/mars3d/Map2.vue
View file @
6a6c31e5
...
...
@@ -48,6 +48,8 @@ export default {
carPlaySpeed
:
1
,
stopPointData
:[],
leadTime
:
false
,
//获取停车时间段以及坐标点
stopCarCoordinates
:[],
}
},
...
...
@@ -137,6 +139,12 @@ export default {
hisCenterData
.
push
(
obj1
);
that
.
historyTrajectoryData
=
[...
hisCenterData
];
//获取停车时间段以及坐标点
if
(
that
.
leadTime
){
HttpReq
.
truckDispatching
.
apimineAlarmHistoryTjQuery
({
number
:
that
.
carNumber
,
bTime
:
bTime
,
eTime
:
eTime
}).
then
((
resTj
)
=>
{
console
.
log
(
resTj
);
that
.
stopCarCoordinates
=
[];
this
.
$nextTick
(()
=>
{
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
...
...
@@ -150,6 +158,22 @@ export default {
}
})
})
}
else
{
that
.
stopCarCoordinates
=
[];
this
.
$nextTick
(()
=>
{
if
(
this
.
appendToBody
)
{
document
.
body
.
appendChild
(
this
.
$el
)
}
if
(
this
.
mapKey
)
{
this
.
initMars3d
(
this
.
options
)
}
else
{
mars3d
.
Resource
.
fetchJson
({
url
:
this
.
url
}).
then
((
data
)
=>
{
this
.
initMars3d
(
data
.
map3d
)
// 构建地图
})
}
})
}
}
}
})
...
...
@@ -262,6 +286,14 @@ export default {
that
.
addDemoGraphic1
(
graphicLayer2
,
item
.
lon
,
item
.
lat
,
item
.
alarmTime
,
item
.
time
);
})
//展示轨迹
that
.
stopCarCoordinates
,
forEach
((
item
,
index
)
=>
{
var
graphicLayer3
=
new
mars3d
.
layer
.
GraphicLayer
();
map
.
addLayer
(
graphicLayer3
);
initGraphicManager
(
graphicLayer3
);
that
.
addDemoGraphic2
(
graphicLayer3
,
item
);
})
//webgl渲染失败后,刷新页面
map
.
on
(
mars3d
.
EventType
.
renderError
,
function
(
event
){
window
.
location
.
reload
();
...
...
@@ -275,7 +307,7 @@ export default {
// 抛出事件
this
.
$emit
(
'
onload
'
,
map
)
},
//车辆轨迹1
//车辆轨迹1
:车辆运动
addGraphic_02
(
graphicLayer2
,
positions
,
truckName
)
{
let
that
=
this
;
var
property
=
new
Cesium
.
SampledPositionProperty
();
...
...
@@ -299,8 +331,8 @@ export default {
width
:
4
,
color
:
"
rgb(251,84,48)
"
,
opacity
:
1.0
,
leadTime
:
that
.
leadTime
?
9999
:
0
,
// 前方的路线不显示
trailTime
:
that
.
leadTime
?
9999
:
0
,
leadTime
:
0
,
// 前方的路线不显示
trailTime
:
0
,
//高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight
:
{
type
:
mars3d
.
EventType
.
click
,
...
...
@@ -356,6 +388,28 @@ export default {
})
graphicLayer
.
addGraphic
(
graphic
)
},
//展示轨迹
addDemoGraphic2
(
graphicLayer
,
item
)
{
const
graphic
=
new
mars3d
.
graphic
.
PolylineEntity
({
positions
:
item
.
lines
,
style
:
{
width
:
6
,
materialType
:
mars3d
.
MaterialType
.
PolylineOutline
,
color
:
Cesium
.
Color
.
ORANGE
,
outlineWidth
:
2
,
outlineColor
:
Cesium
.
Color
.
BLACK
,
label
:
{
text
:
'
开始时间
'
,
font_size
:
18
,
color
:
"
black
"
,
distanceDisplayCondition
:
true
,
distanceDisplayCondition_far
:
500000
,
distanceDisplayCondition_near
:
0
}
},
})
graphicLayer
.
addGraphic
(
graphic
)
},
//测距画线
startDrawGraphic
(
boo
)
{
let
that
=
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment