|
@@ -4,34 +4,53 @@
|
|
|
<div id="map" ref="rootmap"></div>
|
|
|
</div>
|
|
|
|
|
|
-<!-- <el-dialog
|
|
|
- title="提示"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="30%"
|
|
|
- :before-close="handleClose">
|
|
|
- <span>这是一段信息</span>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
- </span>
|
|
|
-</el-dialog> -->
|
|
|
-
|
|
|
- <el-dialog
|
|
|
- title="视频播放"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- v-if="dialogVisible"
|
|
|
- width="50%"
|
|
|
- :before-close="handleClose"
|
|
|
- >
|
|
|
- <div style="width:100%;height:60rem;position:relative">
|
|
|
- <videodiv :cameracode="ccode" style="width:100%;height:100%;position:absolute;top:0;left:0"></videodiv>
|
|
|
- </div>
|
|
|
-
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="handleClose()">关闭</el-button>
|
|
|
- <!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
|
|
|
- </span>
|
|
|
-</el-dialog>
|
|
|
+ <div class="iconSelect" v-if="iconSelect == 1">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="handleChange" >
|
|
|
+ <el-checkbox v-for="item in dict.type.tl_static_type" :label="item.value" :key="item.value" style="margin-top:1rem">
|
|
|
+ <!-- <img class="tipicon" src="../../assets/images/icons/video.png" /> -->
|
|
|
+ <img class="tipicon" :src="imageMap[item.value]" />
|
|
|
+ <span style="color:white">{{item.label}}</span>
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="iconSelect" v-if="iconSelect == 2">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="handleChange" >
|
|
|
+ <el-checkbox v-for="item in dict.type.tl_dt_type" :label="item.raw.cssClass" :key="item.value" style="margin-top:1rem">
|
|
|
+ <!-- <img class="tipicon" src="../../assets/images/icons/video.png" /> -->
|
|
|
+ <img class="tipicon" :src="imageMap[item.raw.cssClass]" />
|
|
|
+ <span style="color:white">{{item.label}}</span>
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="iconSelect" v-if="iconSelect == 3">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="handleChange" >
|
|
|
+ <el-checkbox v-for="item in dict.type.tl_area_type" :label="item.raw.cssClass" :key="item.value" style="margin-top:1rem">
|
|
|
+ <!-- <img class="tipicon" src="../../assets/images/icons/video.png" /> -->
|
|
|
+ <img class="tipicon" :src="imageMap[item.raw.cssClass]" />
|
|
|
+ <span style="color:white">{{item.label}}</span>
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="视频播放"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ v-if="dialogVisible"
|
|
|
+ width="50%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div style="width:100%;height:60rem;position:relative">
|
|
|
+ <videodiv :cameracode="ccode" style="width:100%;height:100%;position:absolute;top:0;left:0"></videodiv>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="handleClose()">关闭</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -56,12 +75,13 @@ import {TileGrid} from "ol/tilegrid/TileGrid";
|
|
|
import {TileImage} from "ol/source/TileImage";
|
|
|
import {XYZ, Vector as SourceVec} from "ol/source";
|
|
|
import {Tile,Vector as LayerVec} from "ol/layer";
|
|
|
+import { Polygon } from "ol/geom"
|
|
|
|
|
|
-import {Circle as CircleStyle, Fill, Stroke, Style, Icon} from 'ol/style';
|
|
|
+import {Circle as CircleStyle, Fill, Stroke, Style, Icon, Text } from 'ol/style';
|
|
|
import {Draw, Modify, Snap} from 'ol/interaction';
|
|
|
// import {OSM, Vector as SourceVec} from 'ol/source';
|
|
|
// import {Tile as TileLayer, Vector as LayerVec} from 'ol/layer';
|
|
|
-import {get} from 'ol/proj';
|
|
|
+import {get,fromLonLat } from 'ol/proj';
|
|
|
import { Feature } from "ol";
|
|
|
|
|
|
|
|
@@ -71,6 +91,7 @@ import { Feature } from "ol";
|
|
|
import videodiv from "@/components/Videoplayer/index.vue"
|
|
|
import {LineString, Point} from "ol/geom";
|
|
|
import { scale } from 'ol/coordinate';
|
|
|
+import { getLineData } from "@/api/qdtl/data";
|
|
|
// import {Icon, Stroke, Style} from "ol/style";
|
|
|
// import {Vector as LayerVec} from "ol/layer";
|
|
|
|
|
@@ -80,8 +101,12 @@ export default {
|
|
|
pointObj:{type:Object},
|
|
|
isEdit:false
|
|
|
},
|
|
|
+ dicts: ['tl_static_type','tl_area_type','tl_dt_type'],
|
|
|
data() {
|
|
|
return {
|
|
|
+ iconSelectArea:true,
|
|
|
+ iconSelect:1,
|
|
|
+ checkList:[],
|
|
|
map: null,
|
|
|
typeSelect:'Point',
|
|
|
source:null,
|
|
@@ -89,18 +114,53 @@ export default {
|
|
|
snap:null,
|
|
|
locations:[],
|
|
|
vector:null,
|
|
|
- pointArry:new Map(),
|
|
|
+ pointArry:{},
|
|
|
+ mapHashMap:{},
|
|
|
+ deviceList:[],
|
|
|
+ areaList:[],
|
|
|
dialogVisible:false,
|
|
|
- ccode:''
|
|
|
+ ccode:'',
|
|
|
+ imgSrc:'require(../../assets/images/icons/',
|
|
|
+ imgtype:'.png)',
|
|
|
+ imageMap:{
|
|
|
+ video:require('../../assets/images/icons/video.png'),
|
|
|
+ location:require('../../assets/images/icons/location.png'),
|
|
|
+ stop:require('../../assets/images/icons/stop.png'),
|
|
|
+ work:require('../../assets/images/icons/work.png'),
|
|
|
+ area:require('../../assets/images/icons/area.png'),
|
|
|
+ bridge:require('../../assets/images/icons/bridge.png'),
|
|
|
+ train:require('../../assets/images/icons/train.png'),
|
|
|
+ rail:require('../../assets/images/icons/rail.png'),
|
|
|
+ yjdw:require('../../assets/images/icons/yjdw.png'),
|
|
|
+ device:require('../../assets/images/icons/device.png'),
|
|
|
+ police:require('../../assets/images/icons/police.png'),
|
|
|
+ wrj:require('../../assets/images/icons/wrj.png'),
|
|
|
+ yxjl:require('../../assets/images/icons/yxjl.png'),
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
components:{
|
|
|
videodiv
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ iconSelect(val, oldVal){//普通的watch监听
|
|
|
+ this.checkList = [];
|
|
|
+ for(var key in this.mapHashMap){
|
|
|
+ this.mapHashMap[key].setVisible(false)
|
|
|
+ }
|
|
|
+ for(var index in this.deviceList){
|
|
|
+ this.deviceList[index].setVisible(false)
|
|
|
+ }
|
|
|
+ for(var index in this.areaList){
|
|
|
+ this.areaList[index].setVisible(false)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
-
|
|
|
this.initdev();
|
|
|
this.initPoint();
|
|
|
+ this.getTrain(),
|
|
|
+ this.getLineList();
|
|
|
window.videosize = "1x1";
|
|
|
// this.addpoint(point);
|
|
|
|
|
@@ -109,27 +169,18 @@ export default {
|
|
|
var that = this
|
|
|
this.map.on("click", function (e) {
|
|
|
// that.addMarker(e.coordinate,'专家站点.png',0.2);
|
|
|
- console.log(e)
|
|
|
var pixel = that.map.getEventPixel(e.originalEvent);
|
|
|
var feature = that.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
|
|
|
return feature;
|
|
|
});
|
|
|
- // var feature = that.map.forEachFeatureAtPixel(e.pixel,
|
|
|
- // function(feature) {
|
|
|
- // console.log(feature);
|
|
|
- // return feature;
|
|
|
- // });
|
|
|
- console.log(feature)
|
|
|
if (feature) { //这里说明我们点击的是点标记,
|
|
|
let tadata = feature.get("tadata"); //我们可以通过给点标记传不同的值,来判断点击不同的点标记触发的事件。
|
|
|
if (tadata) {
|
|
|
if (tadata.sectionId == "line") {
|
|
|
- alert("我是线:" + tadata.towerNumber)
|
|
|
+ // alert("我是线:" + tadata.towerNumber)
|
|
|
}
|
|
|
if (tadata.sectionId == "point") {
|
|
|
- console.log(tadata.data)
|
|
|
that.ccode = tadata.data.cameraIndexCode
|
|
|
- console.log(that.ccode);
|
|
|
window.cameraid = that.ccode;
|
|
|
that.dialogVisible = true
|
|
|
setTimeout(() => {
|
|
@@ -151,65 +202,49 @@ export default {
|
|
|
|
|
|
});
|
|
|
this.map.on('moveend', function (e) {
|
|
|
-
|
|
|
});
|
|
|
|
|
|
+ this.map.on('pointermove', function(e) {
|
|
|
+ // var pixel=this.map.getEventPixel(e.originalEvent);
|
|
|
+ // var feature=this.map.forEachFeatureAtPixel(pixel,
|
|
|
+ // function (feature) {
|
|
|
+ // return feature;
|
|
|
+ // },
|
|
|
+ // {hitTolerance:10}
|
|
|
+ // )
|
|
|
+ // if(feature === undefined){
|
|
|
+ // this.map.getTargetElement().style.cursor="auto"
|
|
|
+ // }else{
|
|
|
+ // this.map.getTargetElement().style.cursor="pointer"
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- initdev: function () {
|
|
|
-
|
|
|
- // function getWMTSLayer(url, layer) {
|
|
|
- // let key = "98ec3e37b32974c2d58ea1a790640fe7"
|
|
|
- // let projection = getProjection("EPSG:3857");
|
|
|
- // let projectionExtent = projection.getExtent();
|
|
|
- // let size = getWidth(projectionExtent) / 256;
|
|
|
-
|
|
|
- // function getResolutions() {
|
|
|
- // let resolutions = [];
|
|
|
- // for (let z = 1; z < 19; ++z) {
|
|
|
- // resolutions[z] = size / Math.pow(2, z);
|
|
|
- // }
|
|
|
- // return resolutions
|
|
|
- // }
|
|
|
-
|
|
|
- // return new TileLayer({
|
|
|
- // source: new WMTS({
|
|
|
- // url: url,
|
|
|
- // layer: layer,
|
|
|
- // style: "default",
|
|
|
- // matrixSet: "w",
|
|
|
- // format: "tiles",
|
|
|
- // tileGrid: new WMTSTileGrid({
|
|
|
- // origin: getTopLeft(projectionExtent),
|
|
|
- // resolutions: getResolutions(),
|
|
|
- // matrixIds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
|
|
|
- // }),
|
|
|
- // }),
|
|
|
-
|
|
|
- // })
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // var projection = getProjection("EPSG:3857");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // const ign = getWMTSLayer('https://t{0-7}.tianditu.gov.cn/vec_w/wmts?tk=98ec3e37b32974c2d58ea1a790640fe7', 'vec');
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // var map = new Map({
|
|
|
- // target: 'map',
|
|
|
- // layers: [
|
|
|
- // ign,
|
|
|
- // getWMTSLayer('https://t{0-7}.tianditu.gov.cn/cva_w/wmts?tk=98ec3e37b32974c2d58ea1a790640fe7', 'cva'),
|
|
|
- // ],
|
|
|
- // view: new View({
|
|
|
- // projection: projection
|
|
|
- // })
|
|
|
- // });
|
|
|
-
|
|
|
+ getTrain(){
|
|
|
+ var trainArry = [[121.645366,31.856052],[121.636002,32.02354],[121.530258,32.086391]];
|
|
|
+ for(var index in trainArry){
|
|
|
+ this.addMarker(trainArry[index],'train.png',0.6,'marker');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getLineList(){
|
|
|
+ getLineData().then(data =>{
|
|
|
+ for(var index in data.data){
|
|
|
+ var obj = data.data[index]
|
|
|
+ if(obj.configKey.indexOf('lined') > -1){
|
|
|
+ var lineLocations ="["+obj.configValue+"]"
|
|
|
+ var json = JSON.parse(lineLocations);
|
|
|
+ this.addline(json,1);
|
|
|
+ }else if(obj.configKey.indexOf('lineun') > -1){
|
|
|
+ var lineLocations ="["+obj.configValue+"]"
|
|
|
+ var json = JSON.parse(lineLocations);
|
|
|
+ this.addline(json,2);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initdev: function () {
|
|
|
var projection = getProjection("EPSG:3857");
|
|
|
const satellite = new Tile({ // 卫星地图
|
|
|
visible: false, // 显示或隐藏(用于切换地图图层(卫星切换街道))
|
|
@@ -269,22 +304,11 @@ const vector = new LayerVec({
|
|
|
|
|
|
const modify = new Modify({source: this.source});
|
|
|
map.addInteraction(modify);
|
|
|
-
|
|
|
- // map.getView().fit([75.0, 20.0, 135.0, 50.0], map.getSize());
|
|
|
this.map = map;
|
|
|
- // this.addDrawLayer();
|
|
|
if(this.isEdit){
|
|
|
this.addInteractions();
|
|
|
}
|
|
|
var that = this;
|
|
|
-
|
|
|
- // map.getView().setCenter(
|
|
|
- // [118.642876, 31.970445]
|
|
|
- // );
|
|
|
- // map.getView().setCenter(this.transpoints([
|
|
|
- // [118.642876, 31.970445]
|
|
|
- // ], 0)[0]);
|
|
|
- // map.getView().setZoom(13);
|
|
|
},
|
|
|
addInteractions() {
|
|
|
var that = this
|
|
@@ -318,16 +342,17 @@ const vector = new LayerVec({
|
|
|
}
|
|
|
},
|
|
|
removeLayer(id){
|
|
|
- var layers = this.pointArry.get(id);
|
|
|
+ var layers = this.pointArry[id];
|
|
|
this.map.removeLayer(layers);
|
|
|
|
|
|
},
|
|
|
- addMarker(lnglats,icon,size,id,data) {
|
|
|
+ addMarker(lnglats,icon,size,id,data,type) {
|
|
|
let tamarker = new Feature({
|
|
|
tadata: {
|
|
|
sectionId: "point",
|
|
|
towerNumber: 22,
|
|
|
data: data,
|
|
|
+ type: type
|
|
|
}, //这里是用来传值用的,在接下来的一章里(事件)中我会讲到。
|
|
|
geometry: new Point(lnglats) //这里是点坐标的位置,这里要注意fromLonLat
|
|
|
});
|
|
@@ -338,48 +363,134 @@ const vector = new LayerVec({
|
|
|
crossOrigin: "anonymous",
|
|
|
src: require("../../assets/images/icons/" + icon), //本地的样式
|
|
|
scale:size
|
|
|
- })
|
|
|
- })
|
|
|
+ }),
|
|
|
+ },)
|
|
|
); //这里是样式
|
|
|
var markerta = new LayerVec({
|
|
|
source: new SourceVec({
|
|
|
features: [tamarker] //这里放的就是之前的那个点,如果要放置多个点直接push到这里面就行了
|
|
|
- })
|
|
|
+ }),
|
|
|
+ zIndex:30
|
|
|
});
|
|
|
- this.pointArry.set(id,markerta);
|
|
|
+ this.pointArry[id]=markerta;
|
|
|
this.map.addLayer(markerta); //这里是执行,执行之后点就出来了
|
|
|
},
|
|
|
- addline: function() {
|
|
|
+ addPoints(data,icon,size,type){
|
|
|
+ var tamarkerArry =[]
|
|
|
+ let tamarker = null
|
|
|
+ for(var index in data){
|
|
|
+ if(type === 'video'){
|
|
|
+ tamarker = new Feature({
|
|
|
+ tadata: {
|
|
|
+ sectionId: "point",
|
|
|
+ towerNumber: 22,
|
|
|
+ data:data[index],
|
|
|
+ type:type
|
|
|
+ }, //这里是用来传值用的,在接下来的一章里(事件)中我会讲到。
|
|
|
+ geometry: new Point([data[index].longitude, data[index].latitude]) //这里是点坐标的位置,这里要注意fromLonLat
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ tamarker = new Feature({
|
|
|
+ tadata: {
|
|
|
+ sectionId: "point",
|
|
|
+ towerNumber: 22,
|
|
|
+ data:data[index],
|
|
|
+ type:type
|
|
|
+ }, //这里是用来传值用的,在接下来的一章里(事件)中我会讲到。
|
|
|
+ geometry: new Point(data[index].fence.split(',')) //这里是点坐标的位置,这里要注意fromLonLat
|
|
|
+ });
|
|
|
+ }
|
|
|
+ tamarker.setStyle(
|
|
|
+ new Style({
|
|
|
+ image: new Icon({
|
|
|
+ color: "#eee",
|
|
|
+ crossOrigin: "anonymous",
|
|
|
+ src: require("../../assets/images/icons/" + icon), //本地的样式
|
|
|
+ scale:size,
|
|
|
+ anchor: [0.5, 60], //锚点
|
|
|
+ anchorOrigin:'top-right', //锚点源
|
|
|
+ anchorXUnits: 'fraction', //锚点X值单位
|
|
|
+ anchorYUnits: 'pixels', //锚点Y值单位
|
|
|
+ offsetOrigin: 'top-right', //偏移原点
|
|
|
+ }),
|
|
|
+ },)
|
|
|
+ ); //这里是样式
|
|
|
+ tamarkerArry.push(tamarker);
|
|
|
+ }
|
|
|
|
|
|
- var points = [
|
|
|
- [118.78, 32.04],
|
|
|
- [118.88, 32.14]
|
|
|
- ]
|
|
|
+ var markerta = new LayerVec({
|
|
|
+ source: new SourceVec({
|
|
|
+ features: tamarkerArry //这里放的就是之前的那个点,如果要放置多个点直接push到这里面就行了
|
|
|
+ }),
|
|
|
+ zIndex:30
|
|
|
+ });
|
|
|
+ // this.pointArry.set(id,markerta);
|
|
|
+ this.map.addLayer(markerta); //这里是执行,执行之后点就出来了
|
|
|
+ markerta.setVisible(false);
|
|
|
+ if(type == 'device'){
|
|
|
+ this.deviceList.push(markerta);
|
|
|
+ }else{
|
|
|
+ this.mapHashMap[type]=markerta;
|
|
|
+ }
|
|
|
+ // markerta.setVisible(true)
|
|
|
|
|
|
+ },
|
|
|
+ addline: function(lnglats,type) {
|
|
|
let line = new Feature({
|
|
|
tadata: {
|
|
|
sectionId: "line",
|
|
|
towerNumber: 22
|
|
|
},
|
|
|
- geometry: new LineString(points)
|
|
|
+ geometry: new LineString(lnglats)
|
|
|
}); //这里要注意写fromLonLat,很重要
|
|
|
- line.setStyle(new Style({
|
|
|
- stroke: new Stroke({
|
|
|
- width: 3,
|
|
|
- color: "#008000"
|
|
|
- })
|
|
|
- }));
|
|
|
- this.linevectorLayer = new LayerVec({
|
|
|
+
|
|
|
+ var style =this.getStyle(type);
|
|
|
+
|
|
|
+ line.setStyle(style);
|
|
|
+
|
|
|
+ var linevectorLayer = new LayerVec({
|
|
|
source: new SourceVec({
|
|
|
features: [line] //要绘制多段线,直接push到这里面就行了
|
|
|
})
|
|
|
});
|
|
|
- this.map.addLayer(this.linevectorLayer); //这里是执行,执行之后点就出来了
|
|
|
-
|
|
|
+ if(type == 'device'){
|
|
|
+ this.deviceList.push(linevectorLayer);
|
|
|
+ linevectorLayer.setVisible(false)
|
|
|
+ }
|
|
|
+ this.map.addLayer(linevectorLayer); //这里是执行,执行之后点就出来了
|
|
|
+ },
|
|
|
+ addPolygon(item) {
|
|
|
+ var polygon = new Feature({
|
|
|
+ geometry: new Polygon(item),
|
|
|
+ type: "polygon",
|
|
|
+ });
|
|
|
+ let style = [
|
|
|
+ new Style({
|
|
|
+ fill: new Fill({
|
|
|
+ color: "rgba(5,96,187,0.2)",
|
|
|
+ }),
|
|
|
+ // 描边
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#0560BB",
|
|
|
+ width:3,
|
|
|
+ lineDash:[10,20],
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex: 10,
|
|
|
+ }),
|
|
|
+ ];
|
|
|
+ polygon.setStyle(style);
|
|
|
+ var polygonLayer = new LayerVec({
|
|
|
+ source: new SourceVec({
|
|
|
+ features: [polygon]
|
|
|
+ })
|
|
|
+ });
|
|
|
+ this.map.addLayer(polygonLayer);
|
|
|
+ this.areaList.push(polygonLayer);
|
|
|
+ polygonLayer.setVisible(false)
|
|
|
},
|
|
|
initPoint(){
|
|
|
var pointObj = this.pointObj;
|
|
|
- console.log(pointObj);
|
|
|
if(pointObj){
|
|
|
if(pointObj.type == 2){
|
|
|
this.addMarker(pointObj.locations.split(','),'左侧-车站-高亮.png',0.2,'marker');
|
|
@@ -417,6 +528,95 @@ const vector = new LayerVec({
|
|
|
handleOpen(){
|
|
|
window.cameraid = this.ccode;
|
|
|
startPreview(window.cameraid,-1);
|
|
|
+ },
|
|
|
+ handleChange(value){
|
|
|
+ for(var key in this.mapHashMap){
|
|
|
+ this.mapHashMap[key].setVisible(false)
|
|
|
+ }
|
|
|
+ for(var index in this.deviceList){
|
|
|
+ this.deviceList[index].setVisible(false)
|
|
|
+ }
|
|
|
+ for(var index in this.areaList){
|
|
|
+ this.areaList[index].setVisible(false)
|
|
|
+ }
|
|
|
+ for(var index in value){
|
|
|
+ if(value[index] == 'device'){
|
|
|
+ for(var index in this.deviceList){
|
|
|
+ this.deviceList[index].setVisible(true)
|
|
|
+ }
|
|
|
+ }else if(value[index] == 'area'){
|
|
|
+ for(var index in this.areaList){
|
|
|
+ this.areaList[index].setVisible(true)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ var mapkey = value[index]
|
|
|
+ if(this.mapHashMap[mapkey]){
|
|
|
+ this.mapHashMap[mapkey].setVisible(true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getStyle(type){
|
|
|
+ var style = new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ width: 3,
|
|
|
+ color: "#008000"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if(type == 1){
|
|
|
+ style =[
|
|
|
+ new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#000000",
|
|
|
+ width:6,
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex:20
|
|
|
+ }),
|
|
|
+ new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#ffffff",
|
|
|
+ width:6,
|
|
|
+ lineDash:[15,15],
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex:21
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ }else if(type == 2){
|
|
|
+ style =[
|
|
|
+ new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#000000",
|
|
|
+ width:6,
|
|
|
+ lineDash:[15,45],
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex:20
|
|
|
+ }),
|
|
|
+ new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#ffffff",
|
|
|
+ width:6,
|
|
|
+ lineDash:[15,45],
|
|
|
+ lineDashOffset:30,
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex:21
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ }else if(type == 'device'){
|
|
|
+ style =new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color:"#07DBFF",
|
|
|
+ width:6,
|
|
|
+ lineDash:[15,45],
|
|
|
+ lineCap:"butt"
|
|
|
+ }),
|
|
|
+ zIndex:20
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return style;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -426,8 +626,20 @@ const vector = new LayerVec({
|
|
|
#map {
|
|
|
height: 100%;
|
|
|
}
|
|
|
-/* .el-dialog__body {
|
|
|
- background: #041824 84%;
|
|
|
- position: relative;
|
|
|
-} */
|
|
|
+
|
|
|
+.iconSelect{
|
|
|
+ position: absolute;
|
|
|
+ top: 10rem;
|
|
|
+ right: 5rem;
|
|
|
+ width: 16rem;
|
|
|
+ min-height: 30rem;
|
|
|
+ background-color: transparent ;
|
|
|
+ padding-left:1rem
|
|
|
+}
|
|
|
+
|
|
|
+.tipicon{
|
|
|
+ width:3rem;
|
|
|
+ height:3rem;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
</style>
|