Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
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
耿迪迪
gassafety
Commits
47c90ac3
Commit
47c90ac3
authored
Sep 01, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_jzl'
parents
0e42773b
e5ad9395
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
16 deletions
+35
-16
gaodeMap.js
gassafety-web/src/utils/gaodeMap.js
+16
-9
gaodeMapView.js
gassafety-web/src/utils/gaodeMapView.js
+12
-7
index.vue
gassafety-web/src/views/device/map/index.vue
+6
-0
index.vue
gassafety-web/src/views/enterprise/mapView/index.vue
+1
-0
No files found.
gassafety-web/src/utils/gaodeMap.js
View file @
47c90ac3
...
@@ -88,7 +88,7 @@ class gaodeMap {
...
@@ -88,7 +88,7 @@ class gaodeMap {
// 抽屉点击的时候让infowindow隐藏
// 抽屉点击的时候让infowindow隐藏
if
(
this
.
leftListClick
)
{
if
(
this
.
leftListClick
)
{
console
.
log
(
"moveStart"
)
console
.
log
(
"moveStart"
)
;
this
.
closeInfoWindow
();
this
.
closeInfoWindow
();
}
}
});
});
...
@@ -330,7 +330,7 @@ class gaodeMap {
...
@@ -330,7 +330,7 @@ class gaodeMap {
}
}
// 如果是新建状态 不出弹框
// 如果是新建状态 不出弹框
if
(
this
.
view
.
targetNum
==
1
)
return
;
if
(
this
.
view
.
targetNum
==
1
)
return
;
console
.
log
(
e
.
target
)
console
.
log
(
e
.
target
)
;
let
options
=
map
.
getStatus
();
let
options
=
map
.
getStatus
();
options
.
scrollWheel
=
false
;
options
.
scrollWheel
=
false
;
map
.
setStatus
(
options
);
map
.
setStatus
(
options
);
...
@@ -558,6 +558,9 @@ class gaodeMap {
...
@@ -558,6 +558,9 @@ class gaodeMap {
//添加事件
//添加事件
polyline
.
on
(
"mouseover"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"mouseover"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"click"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"click"
,
this
.
polylineMouseOver
);
polyline
.
on
(
"mousedown"
,
e
=>
{
this
.
polyLinesColorClear
(
polyline
);
});
polyline
.
on
(
"mouseout"
,
e
=>
{
polyline
.
on
(
"mouseout"
,
e
=>
{
polyline
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
polyline
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
// infoWindow.close();
// infoWindow.close();
...
@@ -576,14 +579,17 @@ class gaodeMap {
...
@@ -576,14 +579,17 @@ class gaodeMap {
polylineMouseOver
=
e
=>
{
polylineMouseOver
=
e
=>
{
console
.
log
(
e
.
type
);
console
.
log
(
e
.
type
);
let
polyline
=
e
.
target
;
let
polyline
=
e
.
target
;
// 如果是无状态或者是新建并且是鼠标移入
// 如果是无状态或者是新建并且是鼠标移入
if
(
this
.
view
.
targetNum
==
0
&&
e
.
type
==
"mouseover"
)
{
if
(
this
.
view
.
targetNum
==
0
&&
e
.
type
==
"mouseover"
)
{
polyline
.
setOptions
({
strokeColor
:
"#F7FE38"
});
polyline
.
setOptions
({
strokeColor
:
"#F7FE38"
});
return
;
return
;
}
}
// 当选择的是新建的时候,线是点不了的
// 当选择的是新建的时候,线是点不了的
if
(
this
.
lineType
==
1
||
this
.
view
.
targetNum
==
1
)
return
;
if
(
this
.
lineType
==
1
||
this
.
view
.
targetNum
==
1
)
return
;
if
((
this
.
view
.
targetNum
==
2
||
this
.
view
.
targetNum
==
3
)
&&
e
.
type
==
"mouseover"
){
this
.
polyLinesColorClear
(
polyline
);
}
// 上方导航的高
// 上方导航的高
let
X
=
20
,
let
X
=
20
,
Y
=
-
20
;
Y
=
-
20
;
...
@@ -640,9 +646,9 @@ class gaodeMap {
...
@@ -640,9 +646,9 @@ class gaodeMap {
// 如果是戍边浮动出现infowindow 就让窗口在固定的位置出现,这样就不显得乱了
// 如果是戍边浮动出现infowindow 就让窗口在固定的位置出现,这样就不显得乱了
if
(
e
.
type
==
"mouseover"
)
{
if
(
e
.
type
==
"mouseover"
)
{
const
coordinates
=
polyline
.
getPath
().
map
(
item
=>
{
const
coordinates
=
polyline
.
getPath
().
map
(
item
=>
{
return
[
item
.
lng
,
item
.
lat
]
return
[
item
.
lng
,
item
.
lat
];
})
})
;
// const { coordinates } = polyline.getExtData().lineData;
// const { coordinates } = polyline.getExtData().lineData;
// 计算出前两个点的中点
// 计算出前两个点的中点
const
arr1
=
coordinates
[
0
];
const
arr1
=
coordinates
[
0
];
...
@@ -669,9 +675,11 @@ class gaodeMap {
...
@@ -669,9 +675,11 @@ class gaodeMap {
// const
// const
};
};
polyLinesColorClear
()
{
polyLinesColorClear
(
polylines
)
{
this
.
polyLines
.
forEach
(
item
=>
{
this
.
polyLines
.
forEach
(
item
=>
{
if
(
item
!=
polylines
)
{
item
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
item
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
}
});
});
}
}
centerNum
(
num1
,
num2
)
{
centerNum
(
num1
,
num2
)
{
...
@@ -709,7 +717,6 @@ class gaodeMap {
...
@@ -709,7 +717,6 @@ class gaodeMap {
}
}
// 新建line增加编辑以及右键菜单
// 新建line增加编辑以及右键菜单
closeInfoWindow
()
{
closeInfoWindow
()
{
this
.
showInfoWindow
&&
this
.
showInfoWindow
.
close
();
this
.
showInfoWindow
&&
this
.
showInfoWindow
.
close
();
this
.
markerInfoWindow
&&
this
.
markerInfoWindow
.
close
();
this
.
markerInfoWindow
&&
this
.
markerInfoWindow
.
close
();
}
}
...
...
gassafety-web/src/utils/gaodeMapView.js
View file @
47c90ac3
...
@@ -54,8 +54,8 @@ class gaodeMap {
...
@@ -54,8 +54,8 @@ class gaodeMap {
view
=
null
;
view
=
null
;
handleInfoWindowOpenFunc
=
null
;
handleInfoWindowOpenFunc
=
null
;
onceFlag
=
false
;
onceFlag
=
false
;
用来判断点击左边抽屉列表的时候移动才消失
//
用来判断点击左边抽屉列表的时候移动才消失
leftListClick
=
false
;
leftListClick
=
false
;
//构造函数中设置中央点默认值
//构造函数中设置中央点默认值
constructor
(
center
)
{
constructor
(
center
)
{
this
.
markers
=
[];
this
.
markers
=
[];
...
@@ -902,19 +902,24 @@ class gaodeMap {
...
@@ -902,19 +902,24 @@ class gaodeMap {
infoWindow
.
setOffset
(
new
AMap
.
Pixel
(
X
,
Y
));
infoWindow
.
setOffset
(
new
AMap
.
Pixel
(
X
,
Y
));
}
else
{
}
else
{
infoWindow
.
setOffset
(
new
AMap
.
Pixel
(
20
,
-
20
));
infoWindow
.
setOffset
(
new
AMap
.
Pixel
(
20
,
-
20
));
this
.
polyLinesColorClear
(
polyline
);
// polyline.setOptions({ strokeColor: "#F7FE38" });
}
}
this
.
boxCollision
(
infoWindow
.
dom
);
this
.
boxCollision
(
infoWindow
.
dom
);
this
.
showInfoWindow
=
infoWindow
;
this
.
showInfoWindow
=
infoWindow
;
// const
// const
};
};
// 所有的线的颜色归位,如果是报警的,就红色,不是就蓝色
// 所有的线的颜色归位,如果是报警的,就红色,不是就蓝色
polyLinesColorClear
()
{
polyLinesColorClear
(
polyline
)
{
this
.
polyLines
.
forEach
(
item
=>
{
this
.
polyLines
.
forEach
(
item
=>
{
if
(
item
!=
polyline
)
{
if
(
item
.
getExtData
().
lineData
.
alarmState
==
1
)
{
if
(
item
.
getExtData
().
lineData
.
alarmState
==
1
)
{
item
.
setOptions
({
strokeColor
:
"#ff0000"
});
item
.
setOptions
({
strokeColor
:
"#ff0000"
});
}
else
{
}
else
{
item
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
item
.
setOptions
({
strokeColor
:
"#2EE7E7"
});
}
}
}
});
});
}
}
...
...
gassafety-web/src/views/device/map/index.vue
View file @
47c90ac3
...
@@ -389,6 +389,8 @@ export default {
...
@@ -389,6 +389,8 @@ export default {
}
}
// 关闭当前的infowindow
// 关闭当前的infowindow
this
.
gaoMap
.
closeInfoWindow
();
this
.
gaoMap
.
closeInfoWindow
();
// 清除所有线的颜色
this
.
gaoMap
.
polyLinesColorClear
();
this
.
deviceType
=
!
this
.
deviceType
;
this
.
deviceType
=
!
this
.
deviceType
;
this
.
gaoMap
.
mapOperateType
=
"add"
;
this
.
gaoMap
.
mapOperateType
=
"add"
;
...
@@ -448,6 +450,8 @@ export default {
...
@@ -448,6 +450,8 @@ export default {
}
}
// 关闭当前的infowindow
// 关闭当前的infowindow
this
.
gaoMap
.
closeInfoWindow
();
this
.
gaoMap
.
closeInfoWindow
();
// 清空管道颜色
this
.
gaoMap
.
polyLinesColorClear
();
this
.
createReset
();
this
.
createReset
();
},
},
deleteDevice
()
{
deleteDevice
()
{
...
@@ -469,6 +473,8 @@ export default {
...
@@ -469,6 +473,8 @@ export default {
}
}
// 关闭当前的infowindow
// 关闭当前的infowindow
this
.
gaoMap
.
closeInfoWindow
();
this
.
gaoMap
.
closeInfoWindow
();
// 清空管道颜色
this
.
gaoMap
.
polyLinesColorClear
();
this
.
createReset
();
this
.
createReset
();
},
},
selectDeviceType
(
val
)
{
selectDeviceType
(
val
)
{
...
...
gassafety-web/src/views/enterprise/mapView/index.vue
View file @
47c90ac3
...
@@ -948,6 +948,7 @@ export default {
...
@@ -948,6 +948,7 @@ export default {
const
e
=
{
const
e
=
{
target
,
target
,
lnglat
:
iten
.
path
,
lnglat
:
iten
.
path
,
};
};
// 如果是原地不动,就直接执行
// 如果是原地不动,就直接执行
if
(
iten
.
path
[
0
]
==
lng
&&
iten
.
path
[
1
]
==
lat
+
0.1
)
{
if
(
iten
.
path
[
0
]
==
lng
&&
iten
.
path
[
1
]
==
lat
+
0.1
)
{
...
...
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