public/assets/images/map/exhaust/fq_blue.pngpublic/assets/images/map/exhaust/fq_bright_green.pngpublic/assets/images/map/exhaust/fq_gray.pngpublic/assets/images/map/exhaust/fq_green.pngpublic/assets/images/map/exhaust/fq_green_xc.pngpublic/assets/images/map/exhaust/fq_orange.pngpublic/assets/images/map/exhaust/fq_red.pngpublic/assets/images/map/exhaust/fq_yellow.pngsrc/api/mapApi.js
@@ -17,5 +17,8 @@ }, getWasteWater (data) { return axios.get(mapUrl.getWasteWater, data) }, GetWasteGas (data) { return axios.get(mapUrl.GetWasteGas, data) } } src/api/mapUrl.js
@@ -5,6 +5,8 @@ export const GetUser = $HOST + '/user/getUser' export const GetWasteGas = $HOST + '/wasteGas/getWasteGas' export const getSolidWaste = $HOST + '/wasteSolid/getSolidWaste' export const getWasteWater = $HOST + '/wasteWater/getWasteWater' src/components/BaseNav/PublicBounced/PublicBounced.vue
@@ -86,16 +86,19 @@ .public-bounced-content { margin: 15px auto; display: flex; align-items: center; //align-items: center; justify-content: space-around; padding: 10px; .public-bounced-content-left { width: 48%; flex: 3; height: 100%; margin-right: 10px; } .public-bounced-content-right { width: 48%; flex: 2; //width: 48%; height: 100%; } } src/components/LayerController/logic/SolidWaste.js
@@ -14,7 +14,6 @@ * @param L leaflet对象 */ this.init = async (layer, L) => { // const SolidWasteIcon = this.SolidWasteIcon() this.animalService = new AnimalService({ L: L, layer: layer @@ -38,7 +37,6 @@ iconAnchor: [25, 25] }) }) layer.addLayer(marker) } } src/components/LayerController/logic/WasteGas.js
@@ -2,40 +2,47 @@ * 废气 */ const AnimalService = require('../service/AnimalService').default const AjaxUtils = require('../../../utils/AjaxUtils').default // const AjaxUtils = require('../../../utils/AjaxUtils').default // 区分不同类型 使用不同img const ImgBlue = '/assets/images/map/exhaust/fq_blue.png' const ImgGray = '/assets/images/map/exhaust/fq_gray.png' const ImagGreen = '/assets/images/map/exhaust/fq_green.png' const ImagBright = '/assets/images/map/exhaust/fq_bright_green.png' const mapApi = require('../../../api/mapApi').default module.exports = function () { /** * 返回marker对象数组 * @param L leaflet对象 */ this.init = (layer, L) => { this.init = async (layer, L) => { this.animalService = new AnimalService({ L: L, layer: layer }) AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', { companyId: 3900100145, id: '', monType: 1, userCode: 'wenchun.deng', monDuration: '', epName: '', secdDeptId: '', contrLevel: '', dataStatus: '', dataFlag: '', runStatus: '', emissTypeId: '' }, function (res) { const data = res.data.Result.DataInfo for (let i = 0; i < data.length; i++) { // 经纬度 位置 const positionX = data[i].Latitude const positionY = data[i].Longitude layer.addLayer(L.marker([positionX, positionY], {})) } }) const res = await mapApi.GetWasteGas() const data = res.Result.DataInfo || {} console.log(data) for (let i = 0; i < data.length; i++) { // 经纬度 位置 const positionX = data[i].Latitude const positionY = data[i].Longitude // 定义类型 用来区分数据 const ContrLevel = data[i].ContrLevel var iconUrl = this.differentTypes(ContrLevel) const marker = L.marker.magic([positionX, positionY], { icon: L.icon({ iconUrl: iconUrl, iconSize: [50, 50], iconAnchor: [25, 25] }) }) layer.addLayer(marker) // layer.addLayer(L.marker([positionX, positionY], {})) } } this.bindTooltip = (layer) => { console.log(layer) return '测试废气' } @@ -43,4 +50,18 @@ console.log(e) this.animalService.pulseEffect(e.latlng) } // 不同类型图片封装 this.differentTypes = (ContrLevel) => { var effectOfChange if (ContrLevel === 1) { effectOfChange = ImgBlue } else if (ContrLevel === 2) { effectOfChange = ImagGreen } else if (ContrLevel === 3) { effectOfChange = ImagBright } else { effectOfChange = ImgGray } return effectOfChange } } src/components/LayerController/service/BusiLayerService.js
@@ -21,7 +21,7 @@ var busiLayer = new BusiLayer() busiLayer.init(layer, this.L) if (busiLayer.bindTooltip) { layer.bindTooltip(busiLayer.bindTooltip(layer)) layer.bindTooltip(busiLayer.bindTooltip) } // 调用click事件 if (busiLayer.clickListener) { src/main.js
@@ -23,6 +23,7 @@ Vue.prototype.L = L Vue.prototype.$config = appConfig Vue.prototype.$echarts = echarts // 挂载echarts window.Vue = Vue // 注册指令7 // registerDirectives(Vue) src/utils/axios.js
@@ -83,7 +83,7 @@ // 创建axios实例 const Service = axios.create({ timeout: 1000 timeout: 5000 }) const CancelToken = axios.CancelToken src/views/MapTemplate.vue
@@ -38,6 +38,9 @@ // import MenuSpecial from '@components/panel/MenuTopic' import LegendPanel from '@components/panel/LegendPanel' import Enterprise from '../components/table/enterprise' // 底图业务js逻辑 // import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater' // import AddGasHelper from '@components/BaseNav/flueGas/flueGas' // // 公共展示数据 import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced' import LayerFactory from '@components/LayerController/service/LayerFactory'