| | |
| | | lon: val.location.x, |
| | | lat: val.location.y, |
| | | }; |
| | | objArr.push(itemObj); |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | if (index == length) { |
| | | if (that.objArr.length <= 0) { |
| | |
| | | }, |
| | | // 显示地块范围 |
| | | getLandmass(res) { |
| | | let that = this; |
| | | if (res.tpye == "园区") { |
| | | |
| | | } else if (res.tpye == "地块") { |
| | | let that = this; |
| | | if (res.type == "园区") { |
| | | |
| | | } else if (res.type == "地块") { |
| | | |
| | | getDiKuanFanWei(res.lon, res.lat).then(response => { |
| | | let center = { lon: 0, lat: 0 }; |
| | | let polygon = that.read(response.geometry); |
| | |
| | | let points = polygon[0].split(","); |
| | | for (let i = 0; i < points.length; i++) { |
| | | let point = points[i].replace(/^\s+|\s+$/g, "").split(" "); |
| | | center.lon += parseFloat(point[0]) / points.length; |
| | | center.lat += parseFloat(point[1]) / points.length; |
| | | geometry.push({ |
| | | x: parseFloat(point[0]), |
| | | y: parseFloat(point[1]), |
| | | z: 0 |
| | | }); |
| | | // center.lon += parseFloat(point[0]) / points.length; |
| | | // center.lat += parseFloat(point[1]) / points.length; |
| | | geometry.push(parseFloat(point[0]), parseFloat(point[1])) |
| | | |
| | | } |
| | | if (that.lacationLine) { |
| | | sgworld.Creator.DeleteObject(that.lacationLine); |
| | | that.lacationLine = null; |
| | | } |
| | | that.lacationLine = sgworld.Creator.createPolyline( |
| | | geometry, |
| | | "#ff0000", |
| | | 1, |
| | | 0, |
| | | "线" |
| | | ); |
| | | that.setLacationLineClear() |
| | | var position = Cesium.Cartesian3.fromDegreesArray(geometry) |
| | | |
| | | that.lacationLine = Viewer.entities.add({ |
| | | name: "立体墙效果", |
| | | wall: { |
| | | positions: position, |
| | | |
| | | |
| | | material: new Cesium.DynamicWallMaterialProperty({ |
| | | color: Cesium.Color.RED, |
| | | duration: 4000 |
| | | }), |
| | | // 设置高度 |
| | | maximumHeights: Array(position.length).fill(80), |
| | | minimumHeights: Array(position.length).fill(10), |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | |
| | | this.instance && this.instance.$destroy(); |
| | | this.instance = null; |
| | | } |
| | | if (this.lacationLine) { |
| | | sgworld.Creator.DeleteObject(this.lacationLine); |
| | | this.lacationLine = null; |
| | | } |
| | | //地块 |
| | | this.setLacationLineClear() |
| | | // 轨迹线 |
| | | this.setClosePathLine(); |
| | | // 漫游 |
| | |
| | | this.setClearPointFly(); |
| | | vueEvents.$emit("queryLayer", false); |
| | | }, |
| | | |
| | | |
| | | setLacationLineClear() { |
| | | if (this.lacationLine) { |
| | | Viewer.entities.remove(this.lacationLine) |
| | | this.lacationLine = null; |
| | | } |
| | | }, |
| | | setClearPointFly() { |
| | | if (this.pointerFly) { |
| | | this.pointerFly && this.pointerFly.end(); |