| | |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | console.log(item,"路线item",item[this.qindex]) |
| | | let graphic = new mars3d.graphic.PolylineEntity({ |
| | | positions: [position,position2], |
| | | style: { |
| | |
| | | |
| | | addTaxiPointInfoGraphic() { |
| | | var Pointsdata = mars3d.global_variables.singleTaxiReplayData; |
| | | for (var i = 0, len = Pointsdata.length; i < len; i++) { |
| | | for (var i = 0, len = Pointsdata.length; i < len-1; i++) { |
| | | // var item = Pointsdata[i]; |
| | | // // var lng = Number(item["lon"]); //经度 |
| | | // // var lat = Number(item["lat"]); //纬度 |
| | | // // var position = null; |
| | | // // if (lng && lat) { |
| | | // // position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | // // } |
| | | // let keys = ["lon","lat"] |
| | | // let array = [] |
| | | // Pointsdata.map(item => { |
| | | // array.push(keys.reduce((result, key) => ({ ...result, [key]: item[key] }), {})) |
| | | // }) |
| | | // let points = [] |
| | | // array.map(item => { |
| | | // points.push(Object.values(item)) |
| | | // }) |
| | | // item = changeNullAndundefinedToEmpty(item) |
| | | var item = Pointsdata[i]; |
| | | // var lng = Number(item["lon"]); //经度 |
| | | // var lat = Number(item["lat"]); //纬度 |
| | | // var position = null; |
| | | // if (lng && lat) { |
| | | // position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | // } |
| | | let keys = ["lon","lat"] |
| | | let array = [] |
| | | Pointsdata.map(item => { |
| | | array.push(keys.reduce((result, key) => ({ ...result, [key]: item[key] }), {})) |
| | | }) |
| | | let points = [] |
| | | array.map(item => { |
| | | points.push(Object.values(item)) |
| | | }) |
| | | var item2 = Pointsdata[i+1]; |
| | | var lng = Number(item["lon"]); //经度 |
| | | var lat = Number(item["lat"]); //纬度 |
| | | var lng2 = Number(item2["lon"]); //经度 |
| | | var lat2 = Number(item2["lat"]); //纬度 |
| | | var position = null; |
| | | var position2 = null; |
| | | if (lng && lat&&lng2&&lat2) { |
| | | position = Cesium.Cartesian3.fromDegrees(lng, lat); |
| | | position2 = Cesium.Cartesian3.fromDegrees(lng2, lat2); |
| | | } |
| | | item = changeNullAndundefinedToEmpty(item) |
| | | let color_value = this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex]); |
| | | console.log(item,"路线item",item[this.qindex],this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex])) |
| | | //points[Pointsdata.length] = [lon,lat] |
| | | var CorridorPrimitive = new mars3d.graphic.CorridorPrimitive({ |
| | | positions: points, |
| | | var CorridorPrimitive = new mars3d.graphic.CorridorEntity({ |
| | | positions: [position,position2], |
| | | style: { |
| | | // length: 60.0, |
| | | width: 10.0, |
| | |
| | | cornerType: Cesium.CornerType.BEVELED, |
| | | // radius: 8.0, |
| | | diffHeight: this.qindex == "co" ? 300 * item[this.qindex] : item[this.qindex] || item[this.qindex] == "/" ? 500 : item[this.qindex], //高度 |
| | | color:this.viewWindow.getLayerPointColorByQindexandValue(1004,this.qindex, item[this.qindex]), |
| | | opacity: 0.6, |
| | | color:color_value, |
| | | opacity: 1, |
| | | // rotationDegree: 45, |
| | | highlight: { |
| | | opacity: 1 |