| | |
| | | // 弹窗数据引进 |
| | | const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').default |
| | | |
| | | const NormalImg = '/assets/images/map/wastewater/fs_green.png' // 正常 |
| | | const NormalImg = '/assets/images/map/wastewater/fs_bright_green.png' // 正常 |
| | | const OffImg = '/assets/images/map/wastewater/fs_gray.png' // 停运 |
| | | const AbnormalImg = '/assets/images/map/wastewater/fs_blue.png' // 异常 |
| | | const MissImg = '/assets/images/map/wastewater/fs_yellow.png' // 缺失 |
| | | const MissImg = '/assets/images/map/wastewater/fs_bright_green.png' // 缺失 |
| | | const AlarmImg = '/assets/images/map/wastewater/fs_red.png' // 报警闪烁 |
| | | const WarnImg = '/assets/images/map/wastewater/fs_orange.png' // 预警闪烁 |
| | | |
| | |
| | | layer: layer |
| | | }) |
| | | const res = await mapApi.getWasteWater() |
| | | // console.log(res) |
| | | const data = res.Result.DataInfo |
| | | // console.log(data) |
| | | const data = res.Result.DataInfo || {} |
| | | for (let i = 0; i < data.length; i++) { |
| | | // 经纬度 位置 |
| | | const positionX = data[i].Latitude |
| | |
| | | // 定义类型 用来区分数据的不同 |
| | | const testValue = data[i].ContrLevel |
| | | const iconUrl = this.differentTypes(testValue) |
| | | const marker = L.marker.magic([positionX, positionY], { |
| | | const marker = L.marker([positionX, positionY], { |
| | | test: data[i], |
| | | icon: L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [50, 50], |
| | | iconAnchor: [25, 25] |
| | | iconSize: [35, 35], |
| | | iconAnchor: [18, 18] |
| | | }) |
| | | }) |
| | | layer.addLayer(marker) |
| | | } |
| | | } |
| | | |
| | | // 分割线------------------------------------------------------------------------------- |
| | | // this. |
| | | this.bindTooltip = (layer) => { |
| | | return layer.options.test.Name |
| | | } |
| | |
| | | const dataValue = { |
| | | StoragePlaceId: e.layer.options.test.StoragePlaceId |
| | | } |
| | | const result = await mapApi.getWasteWater(dataValue) |
| | | const hourValue = { |
| | | onLineMonEmissPointId: '23', |
| | | monItemId: '28,31', |
| | | beginTime: '2020-04-06 15:13:20', |
| | | endTime: '2020-04-07 15:13:20', |
| | | dataType: '2' |
| | | } |
| | | const dateValue = { |
| | | onLineMonEmissPointId: '23', |
| | | monItemId: '28,31', |
| | | beginTime: '2020-04-06', |
| | | endTime: '2020-04-07', |
| | | dataType: '1' |
| | | } |
| | | const hourData = await mapApi.getQueryOnlineMonData(hourValue) |
| | | const dateData = await mapApi.getQueryOnlineMonData(dateValue) |
| | | // console.log(dateData) |
| | | // const drawback = await mapApi.getWasteWaterMonitoring() |
| | | // console.log(drawback) |
| | | const result = await mapApi.getWasteWaterMonitoringDetails(dataValue) |
| | | const PublicBounced = window.Vue.extend(publicBounced) |
| | | const instance = new PublicBounced() |
| | | instance.setData(result) |
| | | instance.setWaterData(e.layer.options.test, result.Result.DataInfo, hourData.Result.DataInfo, dateData.Result.DataInfo, 'feishui') |
| | | // console.log(e.layer.options.test) |
| | | instance.$mount() |
| | | document.body.appendChild(instance.$el) |
| | | this.setPanTo(e.latlng, 80) |
| | | } |
| | | |
| | | // 根据返回值的不同标记不同图片 |
| | |
| | | } |
| | | return testChange |
| | | } |
| | | this.setPanTo = (pos, value) => { |
| | | var position = pos |
| | | position = window.map.latLngToLayerPoint(position) |
| | | position.y += value |
| | | position = window.map.layerPointToLatLng(position) |
| | | window.map.flyTo(position) |
| | | } |
| | | } |