| | |
| | | } else { |
| | | overlayData.show = false |
| | | // this.$parent.removeArrowsListLayer(overlayData) |
| | | let altitude = overlayData.attrParams.item.altitude.split(',') |
| | | let altitude = overlayData.attrParams.item.altitude.split(',').map(item => { |
| | | if (item < 0) { |
| | | item = 0 |
| | | } |
| | | |
| | | item = Number(item) |
| | | |
| | | return item |
| | | }) |
| | | let position = overlayData.attrParams.item.position.slice(11, overlayData.attrParams.item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let positions |
| | | |
| | | if (position.indexOf('(') != -1) { |
| | | position = position.replace("(", "") |
| | | position = position.replace(")", "") |
| | | } |
| | | |
| | | let positions = position |
| | | if (altitude && altitude.length) positions = position.split(';').map((item, index) => `${item},${altitude[index]}`).join(';') |
| | | let coverage = new global.DC.Polygon(positions) |
| | | |
| | |
| | | let color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | let position = item.position.slice(12, item.position.length - 2).replace(/,/g, ';').replace(/ /g, ',') |
| | | |
| | | let positions = position.split(';').map((item, index) => `${item},140`) |
| | | let maxHeight = Math.max(...item.altitude.split(',')) + 5 |
| | | |
| | | let positions = position.split(';').map((item, index) => `${item},${maxHeight}`) |
| | | positions.push(positions[0]) |
| | | positions = positions.join(';') |
| | | if (item.type == 5 && (item.areaType == 2 || item.areaType == 3)) { |
| | |
| | | }) |
| | | } else { |
| | | if (item.areaType == 2) { |
| | | let multiple, speed |
| | | if (item.iconUrl.indexOf('1') != -1) { |
| | | multiple = 250 |
| | | speed = 3 |
| | | } else if (item.iconUrl.indexOf('2') != -1) { |
| | | multiple = 195 |
| | | speed = 3 |
| | | } else { |
| | | multiple = 50 |
| | | speed = 10 |
| | | } |
| | | |
| | | addPlotOverlayData.setStyle({ |
| | | material: new global.DC.WallImageTrailMaterialProperty({ |
| | | image: '/images/jjx.png', |
| | | image: item.iconUrl, |
| | | color: color, |
| | | repeat: { |
| | | x: getLineSpeed(position.split(';').map(item => { |
| | | item.split(',') |
| | | |
| | | return [Number(item.split(',')[0]), Number(item.split(',')[1])] |
| | | })), y: 1 |
| | | }), multiple), y: 1 |
| | | }, |
| | | speed: 10 |
| | | speed: speed |
| | | }) |
| | | }) |
| | | } else { |
| | |
| | | }) |
| | | } else { |
| | | if (overlay.attrParams.item.areaType == 2) { |
| | | let multiple, speed |
| | | |
| | | if (overlay.attrParams.item.iconUrl.indexOf('1') != -1) { |
| | | multiple = 250 |
| | | speed = 3 |
| | | } else if (overlay.attrParams.item.iconUrl.indexOf('2') != -1) { |
| | | multiple = 195 |
| | | speed = 3 |
| | | } else { |
| | | multiple = 50 |
| | | speed = 10 |
| | | } |
| | | |
| | | overlay.setStyle({ |
| | | material: new global.DC.WallImageTrailMaterialProperty({ |
| | | image: '/images/jjx.png', |
| | | image: overlay.attrParams.item.iconUrl, |
| | | color: color, |
| | | repeat: { |
| | | x: getLineSpeed(position.split(';').map(item => { |
| | | item.split(',') |
| | | |
| | | return [Number(item.split(',')[0]), Number(item.split(',')[1])] |
| | | })), y: 1 |
| | | }), multiple), y: 1 |
| | | }, |
| | | speed: 10 |
| | | speed: speed |
| | | }) |
| | | }) |
| | | } else { |
| | |
| | | |
| | | if (params.areaType == 2 || params.areaType == 3) { |
| | | overlay.attrParams.item.altitude = params.altitude |
| | | |
| | | let maxHeight = Math.max(...overlay.attrParams.item.altitude.split(',')) + 5 |
| | | |
| | | overlay.attrParams.item.position = `LINESTRING(${params.position})` |
| | | |
| | | let positions = params.position.split(',').map(item => { |
| | | item = item.split(' ') |
| | | item = new global.DC.Position(item[0], item[1], 140) |
| | | item = new global.DC.Position(item[0], item[1], maxHeight) |
| | | |
| | | return item |
| | | }) |