Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
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 05befc34
authored
Apr 22, 2025
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
b2cb5f3b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
29 deletions
src/assets/scss/map.scss
src/pages/monitor/zoneCar.vue
src/utils/mapBService.js
src/utils/replay.js
src/assets/scss/map.scss
View file @
05befc3
...
...
@@ -43,7 +43,7 @@ h3.uimap-info-title{
background-color
:
#fff
;
border-radius
:
4px
;
border
:
1px
solid
#eee
;
//
border: 1px solid #eee;
.tit
{
padding
:
10px
15px
;
}
...
...
src/pages/monitor/zoneCar.vue
View file @
05befc3
...
...
@@ -228,7 +228,7 @@ export default {
},
methods
:
{
async
initBMap
()
{
console
.
log
(
11111111111
);
//
console.log(11111111111);
this
.
mapObj
=
await
mapService
.
init
(
"map"
);
this
.
mapLoading
=
false
;
window
.
AMap
=
this
.
mapObj
;
...
...
@@ -303,7 +303,7 @@ export default {
{
isOpen
:
true
,
// 是否开启绘制模式
enableDrawingTool
:
false
,
enableCalculate
:
true
,
// 绘制是否进行测距测面
//
enableCalculate: true, // 绘制是否进行测距测面
enableSorption
:
true
,
// 是否开启边界吸附功能
sorptiondistance
:
20
,
// 边界吸附距离
circleOptions
:
styleOptions
,
// 圆的样式
...
...
@@ -382,7 +382,7 @@ export default {
southWest
.
lat
,
northEast
.
lng
);
// 南到北的距离
console
.
log
(
width
,
height
);
//
console.log(width, height);
this
.
rectangleHeight
=
width
.
toFixed
(
0
);
this
.
rectangleWidth
=
height
.
toFixed
(
0
);
},
...
...
src/utils/mapBService.js
View file @
05befc3
...
...
@@ -279,7 +279,6 @@ MapService.prototype = {
return
Circle
},
createInfoWindow
(
marker
,
map
,
div
,
isInfoOpen
,
isInfoAutoMove
)
{
console
.
log
(
div
,
'div'
)
var
self
=
this
;
var
infoWindow
=
self
.
map
.
invoke
(
'InfoWindow'
,
div
,{
enableAutoPan
:
!!
isInfoAutoMove
...
...
src/utils/replay.js
View file @
05befc3
...
...
@@ -60,30 +60,45 @@ const replay = {
replay
.
distance
=
replay
.
dis
.
reduce
(
function
(
prev
,
cur
,
index
,
arr
)
{
return
prev
+
cur
;
});
replay
.
distance
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
const
firstItem
=
replay
.
data
[
0
];
replay
.
navg
=
AMap
.
invoke
(
'LuShu'
,
replayData
,
{
defaultContent
:
replay
.
getNavgInfoContent
(
firstItem
),
autoView
:
true
,
// 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
speed
:
replay
.
getSpeed
(
replay
.
speed
,
replay
.
distance
),
icon
:
AMap
.
invoke
(
'Icon'
,
'https://e-shield-old.glsx.com.cn/images/icon_car.png'
,
AMap
.
invoke
(
'Size'
,
36
,
22
),{
anchor
:
AMap
.
invoke
(
'Size'
,
18
,
11
)
}),
enableRotation
:
true
,
// 是否设置marker随着道路的走向进行旋转
})
AMap
.
invoke
(
'lushuStart'
)
//开始
// AMap.invoke('lushuStop') //停止
// AMap.invoke('lushuPause') //暂停
// AMap.invoke('lushuShowInfoWindow') //打开信息窗口
EventBus
.
$emit
(
'uiMap.replay.initDone'
)
AMap
.
invoke
(
'lushuAddEventListener'
,
'move'
,
(
e
)
=>
{
this
.
idx
=
e
.
target
.
i
;
let
lnglat
=
replayData
[
this
.
idx
]
let
item
=
replay
.
data
[
this
.
idx
]
AMap
.
invoke
(
'lushuSetContent'
,
replay
.
getNavgInfoContent
(
item
))
//设置信息窗口文案
EventBus
.
$emit
(
'uiMap.replay.currAddress'
,
''
);
if
(
this
.
idx
>=
replay
.
data
.
length
-
3
){
EventBus
.
$emit
(
'uiMap.replay.done'
);
}
});
console
.
log
(
replay
.
distance
,
9999999
)
if
(
replay
.
distance
){
replay
.
distance
=
replay
.
distance
/
1000
//算出轨迹的距离(km)
const
firstItem
=
replay
.
data
[
0
];
replay
.
navg
=
AMap
.
invoke
(
'LuShu'
,
replayData
,
{
defaultContent
:
replay
.
getNavgInfoContent
(
firstItem
),
autoView
:
true
,
// 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
speed
:
replay
.
getSpeed
(
replay
.
speed
,
replay
.
distance
),
icon
:
AMap
.
invoke
(
'Icon'
,
'https://e-shield-old.glsx.com.cn/images/icon_car.png'
,
AMap
.
invoke
(
'Size'
,
36
,
22
),{
anchor
:
AMap
.
invoke
(
'Size'
,
18
,
11
)
}),
enableRotation
:
true
,
// 是否设置marker随着道路的走向进行旋转
})
AMap
.
invoke
(
'lushuStart'
)
//开始
// AMap.invoke('lushuStop') //停止
// AMap.invoke('lushuPause') //暂停
// AMap.invoke('lushuShowInfoWindow') //打开信息窗口
EventBus
.
$emit
(
'uiMap.replay.initDone'
)
AMap
.
invoke
(
'lushuAddEventListener'
,
'move'
,
(
e
)
=>
{
this
.
idx
=
e
.
target
.
i
;
let
lnglat
=
replayData
[
this
.
idx
]
let
item
=
replay
.
data
[
this
.
idx
]
AMap
.
invoke
(
'lushuSetContent'
,
replay
.
getNavgInfoContent
(
item
))
//设置信息窗口文案
EventBus
.
$emit
(
'uiMap.replay.currAddress'
,
''
);
if
(
this
.
idx
>=
replay
.
data
.
length
-
3
){
EventBus
.
$emit
(
'uiMap.replay.done'
);
}
});
}
else
{
//距离为0时,单独处理
const
item
=
replay
.
data
[
replay
.
data
.
length
-
1
];
AMap
.
invoke
(
'clearOverlays'
);
replay
.
Marker
=
mapService
.
createCarMarker
(
p2
,
AMap
);
let
infowindow
=
mapService
.
createInfoWindow
(
replay
.
Marker
,
AMap
,
replay
.
getNavgInfoContent
(
item
))
AMap
.
invoke
(
'addOverlay'
,
replay
.
Marker
)
AMap
.
invoke
(
"mapOpenInfoWindow"
,
infowindow
,
p2
)
EventBus
.
$emit
(
'uiMap.replay.initDone'
)
EventBus
.
$emit
(
'uiMap.replay.done'
);
}
},
getDistance
(
p1
,
p2
)
{
...
...
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