Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
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
SQL_Mou
NewTruckTerminalSyetem
Commits
43a76e78
Commit
43a76e78
authored
May 17, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
381dbedf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
8 deletions
+70
-8
Map.vue
src/components/mars3d/Map.vue
+63
-1
config.js
src/config.js
+2
-2
vue.config.js
vue.config.js
+5
-5
No files found.
src/components/mars3d/Map.vue
View file @
43a76e78
...
...
@@ -170,7 +170,69 @@ export default {
});
graphicLayer
.
addGraphic
(
graphic
);
//还可以另外一种写法: graphic.addTo(graphicLayer)
},
//实时位置
addDemoGraphics
(
graphicLayer4
)
{
let
that
=
this
;
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
(),
20
)
// 按20秒运动至指定位置
})
// 定时更新动态位置(setInterval为演示)
setInterval
(()
=>
{
graphicLayer4
.
eachGraphic
((
graphic
)
=>
{
graphic
.
addDynamicPosition
(
that
.
randomPoint
(),
20
)
})
},
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
)
},
//获取实时位置坐标
getShiShiWeiZhiZuoBiaoFn
(){
let
that
=
this
;
httpGet
(
screenMapSetUpQuery
,{
size
:
9999
}).
then
((
res
)
=>
{
});
},
getSampledPositionProperty
(
points
){
let
property
=
new
Cesium
.
SampledPositionProperty
();
let
start
=
this
.
map
.
clock
.
currentTime
;
...
...
src/config.js
View file @
43a76e78
...
...
@@ -4,8 +4,8 @@ const config = {
// BASE_URL: 'http://8.143.203.103:9090', //线上地址2
// REAL_URL: 'http://8.143.203.103:9090', //线上地址2
BASE_URL
:
'
http://192.168.0.1
11:9090
'
,
REAL_URL
:
'
http://192.168.0.1
11:9090
'
,
BASE_URL
:
'
http://192.168.0.1
08:8001
'
,
REAL_URL
:
'
http://192.168.0.1
08:8001
'
,
TOKEN_KEY
:
'
token
'
,
USER_KEY
:
'
userInfo
'
,
...
...
vue.config.js
View file @
43a76e78
...
...
@@ -10,8 +10,8 @@ module.exports = {
productionSourceMap
:
false
,
//去掉打包的时候生成的map文件
lintOnSave
:
false
,
// 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
devServer
:
{
host
:
'
192.168.0.101
'
,
// 也可以直接写IP地址这样方便真机测试
//
host: 'localhost',
//
host: '192.168.0.101', // 也可以直接写IP地址这样方便真机测试
host
:
'
localhost
'
,
port
:
3002
,
// 端口号
https
:
false
,
// https:{type:Boolean}
open
:
true
,
// 配置自动启动浏览器
...
...
@@ -31,13 +31,13 @@ module.exports = {
'
/dianziweilan
'
:
{
target
:
'
http://192.168.0.1
11:9090
'
target
:
'
http://192.168.0.1
08:8001
'
},
'
/auth
'
:
{
target
:
'
http://192.168.0.1
11:9090
'
,
target
:
'
http://192.168.0.1
08:8001
'
,
},
'
/pic
'
:
{
target
:
'
http://192.168.0.1
11
/avatar/
'
,
target
:
'
http://192.168.0.1
08
/avatar/
'
,
pathRewrite
:
{
'
^/pic
'
:
''
},
changeOrigin
:
true
,
},
...
...
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