diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 4dc9f72..0da3842 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -133,7 +133,7 @@ } } if (item.type == '3dModel') { - item.data.forEach(element => { + item.data.forEach(url => { newfiberVectorLayer.add3DModelLayers(newfiberMap, url, item.layername); }); } diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 4dc9f72..0da3842 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -133,7 +133,7 @@ } } if (item.type == '3dModel') { - item.data.forEach(element => { + item.data.forEach(url => { newfiberVectorLayer.add3DModelLayers(newfiberMap, url, item.layername); }); } diff --git a/src/views/sponeScreen/gisMF/newfiberVectorLayer.js b/src/views/sponeScreen/gisMF/newfiberVectorLayer.js index 1ba4bfa..79e73f2 100644 --- a/src/views/sponeScreen/gisMF/newfiberVectorLayer.js +++ b/src/views/sponeScreen/gisMF/newfiberVectorLayer.js @@ -1,4 +1,40 @@ export default class newfiberVectorLayer { + //添加图标标注点 + static addGeojsonPoint(newfiberMap, geojson, newfiberId) { + geojson.features.forEach( + feature => + (feature.properties = Object.assign(feature.properties, { + style_: { + type: NewFiberMap.Enum.VectorType.POLYGON, + options: { + show: true, + material: !!feature.properties.fillcolor ? feature.properties.fillcolor : 'rgba(154,104,171,0.4)', + outline: true, + outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)', + outlineWidthBottom: 3, + }, + name: feature.properties.name != ' ' ? feature.properties.name : null, + id: newfiberId, + labelOptions: { + font: '16px PingFang SC', + color: 'rgba(175, 50, 50,1)', + pixelOffset: [0, 0], + backgroundColor: 'rgba(0,0,0,1)', + showBackground: false, + outlineColor: 'rgba(0, 0, 0, 0.8)', + outlineWidth: 6, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + distanceDisplayCondition: [Number.MIN_VALUE, 7000000], + }, + }, + })) + ); + if (newfiberMap.getLayers(newfiberId).length > 0) { + return; + } else { + newfiberMap.geojsonToMap(geojson); + } + } //添加geojson面 static addGeojsonPolygon(newfiberMap, geojson, newfiberId) { geojson.features.forEach(