| | |
| | | } |
| | | |
| | | |
| | | // 试加载TXT点云文件 |
| | | // function addPrimitivesPointFromJSONTest() { |
| | | // var pointPrimitives = null;// 申明点渲染集合 |
| | | // pointPrimitives = map.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection()); |
| | | // // 读取TXT文件并将TXT内容转换为数组 |
| | | // $.ajax({ |
| | | // url: './data/hn4.txt', |
| | | // dataType: 'text', |
| | | // success: function(data) { |
| | | // // console.log(data) |
| | | // datas = data.split(/\s|[\r\n]/)//将txt每行内容根据空格和换行进行切割 |
| | | // data_list = datas.map(Number)//将切割后的xyz左边转换为数字格式 |
| | | // list = group(data_list,3)//将转换后的数据每六个分为一组 |
| | | // // 循环数组,加载点云 |
| | | // for (var i = 0; i <list.length; i++) { |
| | | // var hn_lon = Number(list[i][0])/distance_half+121.461085; |
| | | // var hn_lat = Number(list[i][1])/distance_half+31.210190; |
| | | // var hn_h = 300-Number(list[i][2]); |
| | | // var color_b = Math.floor(hn_h) |
| | | // if(hn_h<=50){ |
| | | // color = Cesium.Color.fromCssColorString(`rgba(0, ${color_b}, ${color_b}, 1)`) |
| | | // }else if(hn_h<=80){ |
| | | // color = Cesium.Color.fromCssColorString(`rgba(${color_b}, 0, ${color_b}, 1)`) |
| | | // }else{ |
| | | // color = Cesium.Color.fromCssColorString(`rgba(${color_b}, ${color_b}, 0, 1)`) |
| | | // } |
| | | // var position = Cesium.Cartesian3.fromDegrees(hn_lon,hn_lat,hn_h); |
| | | // pointPrimitives.add({ |
| | | // pixelSize: 1, |
| | | // color: color, |
| | | // // outlineColor: Cesium.Color.BLUE, |
| | | // outlineWidth: 0, |
| | | // position: position |
| | | // }); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | // 添加PCI模型 |