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
6f25f3bf
Commit
6f25f3bf
authored
Apr 15, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b9815056
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
2 deletions
+67
-2
Map.vue
src/components/mars3d/Map.vue
+67
-2
No files found.
src/components/mars3d/Map.vue
View file @
6f25f3bf
...
...
@@ -306,7 +306,13 @@ export default {
</tr>
</table>`
;
initGraphicManager
(
graphicLayer1
,
itemText
);
that
.
addGraphic_02
(
graphicLayer1
,
this
.
persons
,
'
卡车一
'
);
//that.addGraphic_02(graphicLayer1,this.persons,'卡车一');
//创建矢量数据图层4
var
graphicLayer4
=
new
mars3d
.
layer
.
GraphicLayer
();
map
.
addLayer
(
graphicLayer4
)
that
.
addDemoGraphics
(
graphicLayer4
);
// 抛出事件
this
.
$emit
(
'
onload
'
,
map
)
...
...
@@ -421,7 +427,66 @@ export default {
}
return
property
;
},
addDemoGraphics
(
graphicLayer4
)
{
let
that
=
this
;
for
(
let
i
=
0
;
i
<
1
;
i
++
)
{
const
graphic
=
new
mars3d
.
graphic
.
ModelPrimitive
({
style
:
{
url
:
"
//data.mars3d.cn/gltf/mars/car/tufangche.glb
"
,
scale
:
0.1
,
minimumPixelSize
:
50
,
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight
:
{
type
:
mars3d
.
EventType
.
click
,
silhouette
:
true
,
silhouetteColor
:
"
#ff0000
"
,
silhouetteSize
:
4
},
label
:
{
// 不需要文字时,去掉label配置即可
text
:
"
鲁A12345
"
,
font_size
:
16
,
color
:
"
#ffffff
"
,
outline
:
true
,
outlineColor
:
"
#000000
"
,
pixelOffsetY
:
-
20
,
distanceDisplayCondition
:
true
,
distanceDisplayCondition_far
:
50000
,
distanceDisplayCondition_near
:
0
}
},
})
graphicLayer4
.
addGraphic
(
graphic
)
}
// 设置动态位置
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
())
// 首次出现的位置
})
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(),
50
)
// 按20秒运动至指定位置
})
// 定时更新动态位置(setInterval为演示)
setInterval
(()
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(),
50
)
})
},
20000
)
},
// 取区域内的随机点
randomPoint
()
{
const
jd
=
this
.
random
(
117.130666
*
1000
,
117.130241
*
1000
)
/
1000
const
wd
=
this
.
random
(
36.655207
*
1000
,
36.665207
*
1000
)
/
1000
console
.
log
(
"
jd
"
,
jd
);
console
.
log
(
"
wd
"
,
wd
);
return
Cesium
.
Cartesian3
.
fromDegrees
(
jd
,
wd
,
500
)
},
random
(
min
,
max
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
+
1
)
+
min
)
}
}
}
</
script
>
...
...
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