diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 7d1d8ec..1bdb850 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -294,153 +294,6 @@ clearInterval(rainDataTimer.value); } } - - // if (item.layername == 'weather_cloud') { - // return newfiberMap.setLayersVisible([item.layername], item.isCheck); - // } - // if (item.layername == 'whiteMap') { - // legendList.value[0]['children'][0][1].isCheck = false; - // legendList.value[0]['children'][1][0].isCheck = false; - // changeMapStyle.mapSetWhiteStyle(newfiberMap); - // } - // if (item.layername == 'blackMap') { - // legendList.value[0]['children'][0][0].isCheck = false; - // legendList.value[0]['children'][1][0].isCheck = false; - // changeMapStyle.mapSetBlueStyle(newfiberMap); - // } - // if (item.layername == 'imageMap') { - // legendList.value[0]['children'][0][0].isCheck = false; - // legendList.value[0]['children'][0][1].isCheck = false; - // changeMapStyle.mapSetImageStyle(newfiberMap); - // } - // if (item.isCheck) { - // if (item.layername == 'topography') { - // newfiberMap.getMap().entities.add({ - // id: 'topography', - // rectangle: { - // coordinates: Cesium.Rectangle.fromDegrees(114.110631109158, 34.6762585421128, 114.550431262765, 34.9438974105791), - // material: new Cesium.ImageMaterialProperty({ - // // 纹理 - // image: topography, - // // repeat: new Cesium.Cartesian2(4, 4), - // // color: Cesium.Color.BLUE, - // transparent: true, - // }), - // }, - // }); - // } - // if (item.layername == 'cesiumPaishuiArea1') { - // legendList.value[0]['children'][5][0].isCheck = false; - // legendList.value[0]['children'][6][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea1(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea2', 'cesiumPaishuiArea3']); - // } - // if (item.layername == 'cesiumPaishuiArea2') { - // legendList.value[0]['children'][4][0].isCheck = false; - // legendList.value[0]['children'][6][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea2(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea1', 'cesiumPaishuiArea3']); - // } - // if (item.layername == 'cesiumPaishuiArea3') { - // legendList.value[0]['children'][4][0].isCheck = false; - // legendList.value[0]['children'][5][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea3(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea1', 'cesiumPaishuiArea2']); - // } - // if (item.type == 'polygon') { - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.data, item.layername); - // } - // // if (item.type == 'point') { - // // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, item.url, item.layername); - // // } - // if (item.type == 'areaWall') { - // newfiberVectorLayer.addGeojsonWall(newfiberMap, item.data, item.layername); - // } - // if (item.layername == 'dynamicWater') { - // let dynamicWaterList = newfiberMap.getMap().scene.primitives._primitives.filter(i => i.key == 'dynamicWater'); - // if (!dynamicWaterList.length) { - // newfiberVectorLayer.addDynamicWater(newfiberMap, item.data, item.layername); - // } else { - // newfiberVectorLayer.setDynamicWaterVisible(item.isCheck); - // } - // } - // if (item.type == '3dModel') { - // item.data.forEach((url, index) => { - // newfiberVectorLayer.add3DModelLayers(newfiberMap, url, item.layername + index); - // }); - // } - // if (item.type == 'point') { - // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, getImageUrl(item.url, 'cesiumMap/legendIcon'), item.layername); - // if (item.dataArea) { - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.dataArea, item.layername); - // } - // if (item.layername == 'rainStation') { - // //雨量站特殊处理,5分钟刷新 - // let rainValue = 0; - // rainDataTimer.value = setInterval(async () => { - // rainValue += 1; - // let res = await realtimeRainfallStatistics({ monitorTargetType: 'rainfall', orderBy: 'tt desc' }); - // if (res && res.code == 200) { - // let rainDataList = res.data; //雨量站 - // rainDataList.forEach(element => { - // element.stName = element.stName + '/' + element.pn05 + 'mm' + rainValue; - // }); - // item.data = cesiumMapCommonLegend.getGeojsonData(rainDataList); - // newfiberMap.removeByIds([item.layername]); - // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, getImageUrl(item.url, 'cesiumMap/legendIcon'), item.layername); - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.dataArea, item.layername); - // } - // }, 300000); - // } - // } - // if (item.layername == 'pipeLineFlow') { - // newfiberVectorLayer.addDynamicLine(item.data, item.layername); - // } - // if (item.type == 'mapServer') { - // let removedLayers = newfiberMap - // .getMap() - // .imageryLayers._layers.filter(layer => layer.imageryProvider.layers && layer.imageryProvider.layers.includes(item.layername)); - // if (!removedLayers.length) { - // newfiberMap.loadWmsLayer({ - // url: '/geoserver/henan_kaifeng/wms', - // layers: 'henan_kaifeng:' + item.layername, - // visible: true, - // }); - // } else { - // console.log(removedLayers); - // removedLayers[0].show = true; - // } - // } - // if (item.layername == 'roadLabel') { - // newfiberMap.setBaseMapByEnum([NewFiberMap.Enum.BaseMap.AMAP_VECTOR_V2]); - // } - // } - // if (!item.isCheck) { - // if (item.layername == 'topography') { - // newfiberMap.getMap().entities.removeById('topography'); - // } - // if (item.layername == 'dynamicWater') { - // newfiberVectorLayer.setDynamicWaterVisible(item.isCheck); - // } - // if (item.type == '3dModel') { - // item.data.forEach((url, index) => { - // newfiberVectorLayer.set3DModelVisible(item.layername + index, item.isCheck); - // }); - // } - // if (item.type == 'mapServer') { - // let removedLayers = newfiberMap - // .getMap() - // .imageryLayers._layers.filter(layer => layer.imageryProvider.layers && layer.imageryProvider.layers.includes(item.layername)); - // removedLayers[0].show = false; - // } - // if (item.layername == 'roadLabel') { - // newfiberMap.setBaseMapByEnum([NewFiberMap.Enum.BaseMap.AMAP_VECTOR_V1]); - // } - // newfiberMap.removeByIds([item.layername]); - // if (rainDataTimer.value) { - // clearInterval(rainDataTimer.value); - // } - // } }; onMounted(() => { cesiumMapCommonLegend.getStationData(); diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 7d1d8ec..1bdb850 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -294,153 +294,6 @@ clearInterval(rainDataTimer.value); } } - - // if (item.layername == 'weather_cloud') { - // return newfiberMap.setLayersVisible([item.layername], item.isCheck); - // } - // if (item.layername == 'whiteMap') { - // legendList.value[0]['children'][0][1].isCheck = false; - // legendList.value[0]['children'][1][0].isCheck = false; - // changeMapStyle.mapSetWhiteStyle(newfiberMap); - // } - // if (item.layername == 'blackMap') { - // legendList.value[0]['children'][0][0].isCheck = false; - // legendList.value[0]['children'][1][0].isCheck = false; - // changeMapStyle.mapSetBlueStyle(newfiberMap); - // } - // if (item.layername == 'imageMap') { - // legendList.value[0]['children'][0][0].isCheck = false; - // legendList.value[0]['children'][0][1].isCheck = false; - // changeMapStyle.mapSetImageStyle(newfiberMap); - // } - // if (item.isCheck) { - // if (item.layername == 'topography') { - // newfiberMap.getMap().entities.add({ - // id: 'topography', - // rectangle: { - // coordinates: Cesium.Rectangle.fromDegrees(114.110631109158, 34.6762585421128, 114.550431262765, 34.9438974105791), - // material: new Cesium.ImageMaterialProperty({ - // // 纹理 - // image: topography, - // // repeat: new Cesium.Cartesian2(4, 4), - // // color: Cesium.Color.BLUE, - // transparent: true, - // }), - // }, - // }); - // } - // if (item.layername == 'cesiumPaishuiArea1') { - // legendList.value[0]['children'][5][0].isCheck = false; - // legendList.value[0]['children'][6][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea1(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea2', 'cesiumPaishuiArea3']); - // } - // if (item.layername == 'cesiumPaishuiArea2') { - // legendList.value[0]['children'][4][0].isCheck = false; - // legendList.value[0]['children'][6][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea2(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea1', 'cesiumPaishuiArea3']); - // } - // if (item.layername == 'cesiumPaishuiArea3') { - // legendList.value[0]['children'][4][0].isCheck = false; - // legendList.value[0]['children'][5][0].isCheck = false; - // cesiumPaiShuiArea.addCesiumPaishuiArea3(newfiberMap); - // newfiberMap.removeByIds(['cesiumPaishuiArea1', 'cesiumPaishuiArea2']); - // } - // if (item.type == 'polygon') { - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.data, item.layername); - // } - // // if (item.type == 'point') { - // // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, item.url, item.layername); - // // } - // if (item.type == 'areaWall') { - // newfiberVectorLayer.addGeojsonWall(newfiberMap, item.data, item.layername); - // } - // if (item.layername == 'dynamicWater') { - // let dynamicWaterList = newfiberMap.getMap().scene.primitives._primitives.filter(i => i.key == 'dynamicWater'); - // if (!dynamicWaterList.length) { - // newfiberVectorLayer.addDynamicWater(newfiberMap, item.data, item.layername); - // } else { - // newfiberVectorLayer.setDynamicWaterVisible(item.isCheck); - // } - // } - // if (item.type == '3dModel') { - // item.data.forEach((url, index) => { - // newfiberVectorLayer.add3DModelLayers(newfiberMap, url, item.layername + index); - // }); - // } - // if (item.type == 'point') { - // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, getImageUrl(item.url, 'cesiumMap/legendIcon'), item.layername); - // if (item.dataArea) { - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.dataArea, item.layername); - // } - // if (item.layername == 'rainStation') { - // //雨量站特殊处理,5分钟刷新 - // let rainValue = 0; - // rainDataTimer.value = setInterval(async () => { - // rainValue += 1; - // let res = await realtimeRainfallStatistics({ monitorTargetType: 'rainfall', orderBy: 'tt desc' }); - // if (res && res.code == 200) { - // let rainDataList = res.data; //雨量站 - // rainDataList.forEach(element => { - // element.stName = element.stName + '/' + element.pn05 + 'mm' + rainValue; - // }); - // item.data = cesiumMapCommonLegend.getGeojsonData(rainDataList); - // newfiberMap.removeByIds([item.layername]); - // newfiberVectorLayer.addGeojsonPoint(newfiberMap, item.data, getImageUrl(item.url, 'cesiumMap/legendIcon'), item.layername); - // newfiberVectorLayer.addGeojsonPolygon(newfiberMap, item.dataArea, item.layername); - // } - // }, 300000); - // } - // } - // if (item.layername == 'pipeLineFlow') { - // newfiberVectorLayer.addDynamicLine(item.data, item.layername); - // } - // if (item.type == 'mapServer') { - // let removedLayers = newfiberMap - // .getMap() - // .imageryLayers._layers.filter(layer => layer.imageryProvider.layers && layer.imageryProvider.layers.includes(item.layername)); - // if (!removedLayers.length) { - // newfiberMap.loadWmsLayer({ - // url: '/geoserver/henan_kaifeng/wms', - // layers: 'henan_kaifeng:' + item.layername, - // visible: true, - // }); - // } else { - // console.log(removedLayers); - // removedLayers[0].show = true; - // } - // } - // if (item.layername == 'roadLabel') { - // newfiberMap.setBaseMapByEnum([NewFiberMap.Enum.BaseMap.AMAP_VECTOR_V2]); - // } - // } - // if (!item.isCheck) { - // if (item.layername == 'topography') { - // newfiberMap.getMap().entities.removeById('topography'); - // } - // if (item.layername == 'dynamicWater') { - // newfiberVectorLayer.setDynamicWaterVisible(item.isCheck); - // } - // if (item.type == '3dModel') { - // item.data.forEach((url, index) => { - // newfiberVectorLayer.set3DModelVisible(item.layername + index, item.isCheck); - // }); - // } - // if (item.type == 'mapServer') { - // let removedLayers = newfiberMap - // .getMap() - // .imageryLayers._layers.filter(layer => layer.imageryProvider.layers && layer.imageryProvider.layers.includes(item.layername)); - // removedLayers[0].show = false; - // } - // if (item.layername == 'roadLabel') { - // newfiberMap.setBaseMapByEnum([NewFiberMap.Enum.BaseMap.AMAP_VECTOR_V1]); - // } - // newfiberMap.removeByIds([item.layername]); - // if (rainDataTimer.value) { - // clearInterval(rainDataTimer.value); - // } - // } }; onMounted(() => { cesiumMapCommonLegend.getStationData(); diff --git a/src/views/sponeScreen/projectHM/index.vue b/src/views/sponeScreen/projectHM/index.vue index ba2f5e9..188095e 100644 --- a/src/views/sponeScreen/projectHM/index.vue +++ b/src/views/sponeScreen/projectHM/index.vue @@ -79,6 +79,23 @@ let datas = res.data || []; if (datas.length > 0) { // 渲染报警图层 + console.log('datas---', datas); + let warningFeatures = []; + datas.forEach(element => { + let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); + warningFeature.properties.size = 1000; + warningFeature.properties.stName = ''; + warningFeatures.push(warningFeature); + }); + let warningGeojson = turf.featureCollection(warningFeatures); + let key = 'warning_monitor'; + bus.emit('getGeojsonByType', { + type: key, + callback: geojson => { + if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); + bus.emit('setLayerVisible', { layername: key, isCheck: true }); + }, + }); } }); }