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
e04bb723
Commit
e04bb723
authored
Sep 14, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卫星地图跟全景地图的切换
parent
4697fb41
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
gaodeMap.js
gassafety-web/src/utils/gaodeMap.js
+15
-0
index.vue
gassafety-web/src/views/device/map/index.vue
+35
-1
No files found.
gassafety-web/src/utils/gaodeMap.js
View file @
e04bb723
...
@@ -125,6 +125,21 @@ class gaodeMap {
...
@@ -125,6 +125,21 @@ class gaodeMap {
panTo
(
lnglat
)
{
panTo
(
lnglat
)
{
this
.
myMap
.
panTo
(
lnglat
);
this
.
myMap
.
panTo
(
lnglat
);
}
}
changeMap
(
bool
)
{
// 卫星图
if
(
!
bool
)
{
if
(
this
.
satellite
)
return
;
this
.
satellite
=
new
AMap
.
TileLayer
.
Satellite
();
this
.
myMap
.
addLayer
(
this
.
satellite
);
}
else
{
if
(
this
.
satellite
)
{
this
.
myMap
.
removeLayer
(
this
.
satellite
);
this
.
satellite
=
null
;
}
}
}
/**
/**
* 获取map
* 获取map
* @returns {AMap.Map}
* @returns {AMap.Map}
...
...
gassafety-web/src/views/device/map/index.vue
View file @
e04bb723
...
@@ -103,6 +103,11 @@
...
@@ -103,6 +103,11 @@
:class=
"{ back: backFlag, opacity: drawerOpacity }"
:class=
"{ back: backFlag, opacity: drawerOpacity }"
@
click
.
stop=
"drawerdrawer"
@
click
.
stop=
"drawerdrawer"
>
>
<div
class=
"mapChange"
>
<div
:class=
"{ active: !mapStyle }"
@
click=
"mapChange(1)"
>
卫星地图
</div>
<div
:class=
"{ active: mapStyle }"
@
click=
"mapChange(2)"
>
全景地图
</div>
</div>
<div
class=
"switch"
@
click=
"backFlag = !backFlag"
>
<div
class=
"switch"
@
click=
"backFlag = !backFlag"
>
<img
v-if=
"!backFlag"
src=
"@/assets/images/l.png"
alt=
""
/>
<img
v-if=
"!backFlag"
src=
"@/assets/images/l.png"
alt=
""
/>
<img
v-else
src=
"@/assets/images/r.png"
alt=
""
/>
<img
v-else
src=
"@/assets/images/r.png"
alt=
""
/>
...
@@ -240,6 +245,8 @@ export default {
...
@@ -240,6 +245,8 @@ export default {
targetNum
:
0
,
targetNum
:
0
,
backFlag
:
true
,
backFlag
:
true
,
// 卫星与全景地图的切换
mapStyle
:
true
,
// 抽屉内的滚动条的高需要赋值赋值
// 抽屉内的滚动条的高需要赋值赋值
boxHeight
:
""
,
boxHeight
:
""
,
boxWidth
:
""
,
boxWidth
:
""
,
...
@@ -371,6 +378,15 @@ export default {
...
@@ -371,6 +378,15 @@ export default {
this
.
gaoMap
.
markerShow
(
4
,
false
);
this
.
gaoMap
.
markerShow
(
4
,
false
);
}
}
},
},
// 卫星地图与全景地图的切换
mapChange
(
num
)
{
if
(
num
==
1
)
{
this
.
mapStyle
=
false
;
}
else
{
this
.
mapStyle
=
true
;
}
this
.
gaoMap
.
changeMap
(
this
.
mapStyle
);
},
addDevice
()
{
addDevice
()
{
if
(
this
.
iconClass
==
"icon-create"
)
{
if
(
this
.
iconClass
==
"icon-create"
)
{
this
.
targetNum
=
this
.
targetNum
!=
1
?
1
:
0
;
this
.
targetNum
=
this
.
targetNum
!=
1
?
1
:
0
;
...
@@ -1127,6 +1143,24 @@ input[type="radio"] {
...
@@ -1127,6 +1143,24 @@ input[type="radio"] {
&
.back
{
&
.back
{
left
:
-248px
;
left
:
-248px
;
}
}
.mapChange
{
right
:
-178px
;
top
:
10px
;
color
:
#fff
;
position
:
absolute
;
display
:
flex
;
div
{
padding
:
4px
8px
;
border
:
1px
solid
#fff
;
margin-left
:
8px
;
cursor
:
pointer
;
&
.active
,
&
:hover
{
background-color
:
#053b6a
;
color
:
#31eaea
;
}
}
}
.scroll
{
.scroll
{
// height: 100%;
// height: 100%;
position
:
relative
;
position
:
relative
;
...
...
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