| | |
| | | // 显示地块范围 |
| | | getLandmass(res) { |
| | | let that = this; |
| | | // 划线 |
| | | getDiKuanFanWei(res.lon, res.lat).then(response => { |
| | | let center = { lon: 0, lat: 0 }; |
| | | let polygon = that.read(response.geometry); |
| | | if (polygon.length > 0) { |
| | | var 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 |
| | | }); |
| | | if (res.tpye == "园区") { |
| | | |
| | | } else if (res.tpye == "地块") { |
| | | getDiKuanFanWei(res.lon, res.lat).then(response => { |
| | | let center = { lon: 0, lat: 0 }; |
| | | let polygon = that.read(response.geometry); |
| | | if (polygon.length > 0) { |
| | | var 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 |
| | | }); |
| | | } |
| | | if (that.lacationLine) { |
| | | sgworld.Creator.DeleteObject(that.lacationLine); |
| | | that.lacationLine = null; |
| | | } |
| | | that.lacationLine = sgworld.Creator.createPolyline( |
| | | geometry, |
| | | "#ff0000", |
| | | 1, |
| | | 0, |
| | | "线" |
| | | ); |
| | | } |
| | | if (that.lacationLine) { |
| | | sgworld.Creator.DeleteObject(that.lacationLine); |
| | | that.lacationLine = null; |
| | | } |
| | | that.lacationLine = sgworld.Creator.createPolyline( |
| | | geometry, |
| | | "#ff0000", |
| | | 1, |
| | | 0, |
| | | "线" |
| | | ); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | read(wkt) { |
| | |
| | | }); |
| | | setTimeout(() => { |
| | | this.setClearPointFly(); |
| | | }, 5000); |
| | | }, 8000); |
| | | }, |
| | | changeCameraHeading(res) { |
| | | var nextIndex = this.marksIndex + 1; |