Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pingshan-ranqi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
yaqizhang
pingshan-ranqi
Commits
bfcb8b20
Commit
bfcb8b20
authored
Nov 24, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频以及桑额报警器加上text
parent
15dcf7ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
gaodeMapView.js
gassafety-web/src/utils/gaodeMapView.js
+25
-6
No files found.
gassafety-web/src/utils/gaodeMapView.js
View file @
bfcb8b20
...
...
@@ -79,7 +79,7 @@ class gaodeMap {
// 用来判断点击左边抽屉列表的时候移动才消失
leftListClick
=
false
;
// 报警器移动的时候用来存储经纬度的,用途是判断司徒是否移动
oldLng
=
[];
oldLng
=
[];
//构造函数中设置中央点默认值
constructor
(
center
)
{
this
.
markers
=
[];
...
...
@@ -333,6 +333,8 @@ class gaodeMap {
}
// 摄像头
if
(
DEVICE_TYPE
.
VIDEO
==
markerType
)
{
// 摄像头
const
{
longitude
,
...
...
@@ -351,6 +353,7 @@ class gaodeMap {
pos
:
[
longitude
,
latitude
],
deviceType
:
type
});
marker
.
text
=
this
.
addText
({
text
:
data
.
videoName
,
position
:[
data
.
longitude
,
data
.
latitude
]});
marker
.
markerType
=
markerType
;
marker
.
data
=
data
;
marker
.
infoWindow
=
infoWindow
;
...
...
@@ -378,6 +381,7 @@ class gaodeMap {
DEVICE_TYPE
.
DETECTOR_CM
==
markerType
||
DEVICE_TYPE
.
DETECTOR_FM
==
markerType
)
{
marker
.
text
=
this
.
addText
({
text
:
data
.
nickName
,
position
:[
data
.
longitude
,
data
.
latitude
]});
marker
.
markerType
=
markerType
;
marker
.
data
=
data
;
marker
.
infoWindow
=
infoWindow
;
...
...
@@ -415,10 +419,10 @@ class gaodeMap {
// 因为报警器会出现同一位置的情况,如果是同一个位置,直接显示infoWindow,
// 如果不是同一位置,移动完了在显示
if
(
this
.
oldLng
[
0
]
==
data
.
longitude
&&
this
.
oldLng
[
1
]
==
data
.
latitude
)
{
console
.
log
(
"原地没动"
)
console
.
log
(
"原地没动"
)
;
this
.
detectorOnlyOpen
(
e
);
}
else
{
console
.
log
(
"动了"
)
console
.
log
(
"动了"
)
;
// 回调,先移动,后展示infowindow
this
.
handleInfoWindowOpenFunc
=
()
=>
{
...
...
@@ -521,6 +525,7 @@ class gaodeMap {
if
(
markerType
!=
DEVICE_TYPE
.
DETECTOR_ONLY
)
{
// 刚进来所有的设备都是隐藏的
marker
.
hide
();
marker
.
text
?.
hide
();
this
.
markers
.
push
(
marker
);
}
else
{
}
...
...
@@ -542,7 +547,18 @@ class gaodeMap {
return
marker
;
}
// 添加文本标记
addText
(
data
){
let
text
=
new
AMap
.
Text
({
position
:
data
.
position
,
anchor
:
"bottom-center"
,
offset
:
new
AMap
.
Pixel
(
0
,
-
32
),
text
:
data
.
text
,
style
:
{
"font-size"
:
"12px"
,
"color"
:
"#fff"
,
"background-color"
:
"#063157cc"
}
});
this
.
myMap
.
add
(
text
);
return
text
;
}
// 值班人员
wokerManOpen
=
e
=>
{
this
.
markerType
=
e
.
target
.
markerType
;
...
...
@@ -1511,6 +1527,8 @@ class gaodeMap {
}
}
bool
?
item
.
show
()
:
item
.
hide
();
bool
?
item
?.
text
.
show
()
:
item
?.
text
.
hide
();
}
// //console.log("deviceType",deviceType);
});
...
...
@@ -1523,6 +1541,7 @@ class gaodeMap {
})
?.
forEach
(
item
=>
{
bool
?
item
.
show
()
:
item
.
hide
();
bool
?
item
?.
text
.
show
()
:
item
?.
text
.
hide
();
// 如果有报警器,就让报警器一起隐藏
if
(
this
.
detcetorMarker
&&
...
...
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