Commit 97f2a337 authored by 纪泽龙's avatar 纪泽龙

Merge branch 'develop_jzl'

parents 2eeb8c08 eab53332
...@@ -447,7 +447,7 @@ class gaodeMap { ...@@ -447,7 +447,7 @@ class gaodeMap {
case DEVICE_TYPE.REGEULATORBOX: { case DEVICE_TYPE.REGEULATORBOX: {
let icon = new AMap.Icon({ let icon = new AMap.Icon({
//size: new AMap.Size(51, 23), //size: new AMap.Size(51, 23),
image: require("../assets/images/tiaoyaxiang.png") image: require("../assets/oldImages/tiaoyaxiang.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -455,7 +455,7 @@ class gaodeMap { ...@@ -455,7 +455,7 @@ class gaodeMap {
case DEVICE_TYPE.VALUEWELL: { case DEVICE_TYPE.VALUEWELL: {
let icon = new AMap.Icon({ let icon = new AMap.Icon({
//size: new AMap.Size(51, 23), //size: new AMap.Size(51, 23),
image: require("../assets/images/famenjing.png") image: require("../assets/oldImages/famenjing.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -463,7 +463,7 @@ class gaodeMap { ...@@ -463,7 +463,7 @@ class gaodeMap {
case DEVICE_TYPE.FLOWMETER: { case DEVICE_TYPE.FLOWMETER: {
let icon = new AMap.Icon({ let icon = new AMap.Icon({
//size: new AMap.Size(51, 23), //size: new AMap.Size(51, 23),
image: require("../assets/images/liuliangji.png") image: require("../assets/oldImages/liuliangji.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -487,7 +487,7 @@ class gaodeMap { ...@@ -487,7 +487,7 @@ class gaodeMap {
case DEVICE_TYPE.PRESSUREGAGE: { case DEVICE_TYPE.PRESSUREGAGE: {
let icon = new AMap.Icon({ let icon = new AMap.Icon({
//size: new AMap.Size(51, 23), //size: new AMap.Size(51, 23),
image: require("../assets/images/yalibiao.png") image: require("../assets/oldImages/yalibiao.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
......
...@@ -71,7 +71,7 @@ class gaodeMap { ...@@ -71,7 +71,7 @@ class gaodeMap {
pitch: 8, pitch: 8,
zoom: 9, zoom: 9,
//mapStyle: 'amap://styles/darkblue', //mapStyle: 'amap://styles/darkblue',
mapStyle: 'amap://styles/1c84d2203793b0f622df2cda53db1afd', mapStyle: "amap://styles/1c84d2203793b0f622df2cda53db1afd"
}); });
this.myMap = map; this.myMap = map;
this.myMap.on("mousedown", e => { this.myMap.on("mousedown", e => {
...@@ -135,6 +135,20 @@ class gaodeMap { ...@@ -135,6 +135,20 @@ class gaodeMap {
}); });
this.districtBoundaries(); this.districtBoundaries();
} }
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;
}
}
}
// 地图移动结束 // 地图移动结束
/** /**
...@@ -1020,14 +1034,14 @@ class gaodeMap { ...@@ -1020,14 +1034,14 @@ class gaodeMap {
dom = e.target.dom; dom = e.target.dom;
disX = e.originEvent.clientX - dom.offsetLeft; disX = e.originEvent.clientX - dom.offsetLeft;
disY = e.originEvent.clientY - dom.offsetTop; disY = e.originEvent.clientY - dom.offsetTop;
console.log(disX,disY); console.log(disX, disY);
window.addEventListener("mousemove", windowMove); window.addEventListener("mousemove", windowMove);
}); });
const windowMove = e => { const windowMove = e => {
const mouseX = e.clientX; const mouseX = e.clientX;
const mouseY = e.clientY const mouseY = e.clientY;
const domTop = mouseY -disY; const domTop = mouseY - disY;
const domLeft = mouseX- disX; const domLeft = mouseX - disX;
// console.log(domTop,domLeft) // console.log(domTop,domLeft)
dom.style.top = domTop + "px"; dom.style.top = domTop + "px";
dom.style.left = domLeft + "px"; dom.style.left = domLeft + "px";
......
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
:class="{ back: backFlag, opacity: drawerOpacity }" :class="{ back: backFlag, opacity: drawerOpacity }"
@click.stop="drawerClick" @click.stop="drawerClick"
> >
<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="" />
...@@ -261,7 +265,7 @@ ...@@ -261,7 +265,7 @@
</template> </template>
<!-- 无数据 --> <!-- 无数据 -->
<template v-else> <template v-else>
<div style="padding-left: 5px">暂无数据</div> <div style="padding-left: 5px;color:#fff;">暂无数据</div>
</template> </template>
</div> </div>
</el-collapse-transition> </el-collapse-transition>
...@@ -399,6 +403,7 @@ export default { ...@@ -399,6 +403,7 @@ export default {
drawerOpacity: false, drawerOpacity: false,
//抽屉是否收回 //抽屉是否收回
backFlag: true, backFlag: true,
mapStyle: true,
}; };
}, },
created() { created() {
...@@ -425,7 +430,7 @@ export default { ...@@ -425,7 +430,7 @@ export default {
}, },
methods: { methods: {
onResize() { onResize() {
this.boxHeight = document.body.clientHeight - 81; this.boxHeight = document.body.clientHeight - 80;
this.boxWidth = document.body.clientWidth; this.boxWidth = document.body.clientWidth;
console.log("挂在"); console.log("挂在");
}, },
...@@ -444,6 +449,15 @@ export default { ...@@ -444,6 +449,15 @@ export default {
this.rightBottomData(); this.rightBottomData();
// this.backFlag = false; // this.backFlag = false;
}, },
// 更改卫星图
mapChange(num) {
if (num == 1) {
this.mapStyle = false;
} else {
this.mapStyle = true;
}
this.gaoMap.changeMap(this.mapStyle);
},
// 获取地图上的资源 // 获取地图上的资源
getResource() { getResource() {
...@@ -1613,16 +1627,34 @@ input[type="radio"] { ...@@ -1613,16 +1627,34 @@ input[type="radio"] {
transition: 0.2s linear; transition: 0.2s linear;
// background: #fff; // background: #fff;
// background: #061d3380; // background: #061d3380;
background: rgba(6,29,51,0.8); background: rgba(6, 29, 51, 0.8);
// background: red; // background: red;
opacity: 0; opacity: 0;
// 优化抽屉出来回去 // 优化抽屉出来回去
&.opacity { &.opacity {
opacity: 1; opacity: 1;
} }
&.back { &.back {
left: -348px; left: -348px;
} }
.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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment