| | |
| | | var layer_shanghai_roads_202; |
| | | var layer_sifaju_effect_203; |
| | | var layer_shanghai_mask_300; |
| | | var polinlayer |
| | | var pci_data = []; |
| | | var MR_data = []; |
| | | var MR_msisdn1; |
| | |
| | | var points17 = [] |
| | | var initGraphic |
| | | var polinlayer1 |
| | | var data_repoint = [] |
| | | var data_msisdn_position = [] |
| | | var data_msisdn_list = [] |
| | | // import data from '../data/sites.js' |
| | | var get_JSON = { |
| | | ruijin_url:"http://localhost:4500/dataservice/Bdata?bid=" |
| | | } |
| | | // 页面初始化,创建楼层按键 |
| | | $(document).ready(function(){ |
| | | data_repoint = repoint.data; |
| | | data_msisdn_position = msisdn_position_data.data; |
| | | data_msisdn_list = msisdn_list_data.RECORDS |
| | | var btn_box_html = '' |
| | | for(let i=1;i<23;i++){ |
| | | btn_box_html += `<button style="margin-right:4px;" class="${i}">F${i}</button>` |
| | | } |
| | | $("#building_btn").append(btn_box_html) |
| | | // $.ajax({ |
| | | // type: 'get', |
| | | // dataType: 'json', |
| | | // async: true,//同步 |
| | | // url: `http://localhost:4500/dataservice/Bdata?bid=get_msisdn_msg`, |
| | | // success:function(data){ |
| | | // console.log(data.data.data,"msisdn") |
| | | // msisdn_msg = data.data.data |
| | | // for(let i=0;i<msisdn_msg.length;i++){ |
| | | // floor_position_floor[i] = [] |
| | | // } |
| | | // }, |
| | | // error: function (request, textStatus) { |
| | | |
| | | // } |
| | | // }) |
| | | $.getJSON('data/msisdn_list.json',(result)=>{ |
| | | |
| | | console.log("e") |
| | | let data = result.RECORDS |
| | | console.log(data) |
| | | msisdn_list = data |
| | | |
| | | msisdn_list = data_msisdn_list |
| | | for(let i=0;i<msisdn_list.length;i++){ |
| | | floor_linght[i] = [] |
| | | } |
| | | console.log(floor_linght) |
| | | }) |
| | | |
| | | $.getJSON('data/msisdn_position.json',(result)=>{ |
| | | console.log(result.data,"data") |
| | | MR_data = result.data; |
| | | MR_data = data_msisdn_position; |
| | | if(MR_data.length>=0){ |
| | | data_yn = '<p>定位运行</p>' |
| | | }else{ |
| | |
| | | return item.msisdn == msisdn_list[i].msisdn |
| | | }) |
| | | } |
| | | }) |
| | | $.getJSON('data/repoint.json',(result)=>{ |
| | | console.log("eeee") |
| | | repoint_list = result.data; |
| | | repoint_list = data_repoint; |
| | | for(let i=0;i<repoint_list.length;i++){ |
| | | if(Number(repoint_list[i].lat)<31.211869869520108){ |
| | | repoint_list[i].lat = 31.211869869520108 |
| | |
| | | }) |
| | | } |
| | | } |
| | | console.log(floor_linght) |
| | | }) |
| | | |
| | | // $.ajax({ |
| | | // type:'get', |
| | | // dataType:'json', |
| | | // async:true, |
| | | // url:'http://localhost:4500/dataservice/Bdata?bid=get_ruijin_outside&floor_=7', |
| | | // success:function(data){ |
| | | // console.log("e") |
| | | // let datas = data.data.data |
| | | // console.log(datas) |
| | | // for(let i=0;i<datas.length;i++){ |
| | | // let item = datas[i] |
| | | // points17[i] = [item.lon,item.lat] |
| | | // } |
| | | |
| | | // const graphic_17 = new mars3d.graphic.WallEntity({ |
| | | // positions:points17, |
| | | // style: { |
| | | // closure: true, |
| | | // diffHeight: 2, |
| | | // } |
| | | // }) |
| | | // graphicLayer17.addGraphic(graphic_17) |
| | | |
| | | |
| | | // } |
| | | // }) |
| | | |
| | | }) |
| | | // |
| | |
| | | if(floor_linght.length>0){ |
| | | for(let i=0;i<floor_linght.length;i++){ |
| | | for(let j=0;j<22;j++){ |
| | | msisdn_light(floor_linght[i][j],`msisdn_graphic${i}`,`#00${i}${i}${i}${i}`,"img/textures/arrow2.png",0,floor_position_light) |
| | | msisdn_light2(floor_linght[i][j],`msisdn_graphic${i}`,`#00${i}${i}${i}${i}`,"img/textures/arrow2.png",15*(j-1),floor_position_light2) |
| | | console.log(floor_linght[i][j]) |
| | | msisdn_light(floor_linght[i][j],`msisdn_graphic${i}`,`#00${i}${i}${i}${i}`,"img/textures/arrow2.png",0) |
| | | msisdn_light2(floor_linght[i][j],`msisdn_graphic${i}`,`#00${i}${i}${i}${i}`,"img/textures/arrow2.png",15*(j+1)) |
| | | } |
| | | } |
| | | } |
| | | |
| | | console.log(floor_position_light[0].points[0]) |
| | | console.log(floor_position_light[0].points[0],"打印路径") |
| | | } |
| | | |
| | | // 将获得的数据高度转换成适应大楼模型的高度 |
| | |
| | | if(h1<=4.5){ |
| | | h5 = 1 |
| | | }else{ |
| | | h2 = h1-4.5-1 |
| | | h2 = h1-4.5 |
| | | h3 = h2/2.8 |
| | | h4 = Math.floor(h3)+2 |
| | | h5 = h4*3 |
| | |
| | | return h2 |
| | | |
| | | } |
| | | function light_graphic(code){ |
| | | var light_graphic = name_ = new mars3d.layer.GraphicLayer({ |
| | | id:code, |
| | | pid:104, |
| | | name:code, |
| | | show:true |
| | | }) |
| | | light_graphic_list.push(light_graphic) |
| | | map.addLayer(light_graphic) |
| | | } |
| | | // function light_graphic(code){ |
| | | // var light_graphic = name_ = new mars3d.layer.GraphicLayer({ |
| | | // id:code, |
| | | // pid:104, |
| | | // name:code, |
| | | // show:true |
| | | // }) |
| | | // light_graphic_list.push(light_graphic) |
| | | // map.addLayer(light_graphic) |
| | | // } |
| | | // 封装设备定位曲线的创建方法 |
| | | function msisdn_light(data,map_name_,color,image_url,hh=0,arr_){ |
| | | var polinlayer = new mars3d.layer.GraphicLayer({ |
| | | pid:104, |
| | | // name:code, |
| | | show:false |
| | | function msisdn_light(data,map_name_,color,image_url,hh=0){ |
| | | polinlayer = new mars3d.layer.GraphicLayer({ |
| | | pid:105, |
| | | name:`合并后${data.name_}轨迹`, |
| | | show:true |
| | | }) |
| | | map.addLayer(polinlayer) |
| | | let len = data.length |
| | |
| | | hasHeightEdit:true |
| | | }) |
| | | polinlayer.addGraphic(map_name_) |
| | | arr_.push(map_name_) |
| | | floor_position_light.push(map_name_) |
| | | } |
| | | } |
| | | function msisdn_light2(data,map_name_,color,image_url,hh=0,arr_){ |
| | | function msisdn_light2(data,map_name_,color,image_url,hh=0){ |
| | | polinlayer1 = new mars3d.layer.GraphicLayer({ |
| | | pid:104, |
| | | // name:code, |
| | | pid:106, |
| | | name:`展开后${data.name_}轨迹`, |
| | | show:false |
| | | }) |
| | | map.addLayer(polinlayer1) |
| | |
| | | // 分别计算出两个点的高 |
| | | let h1 = finalHeight(data[i]["height"])+hh |
| | | let h2 = finalHeight(data[i+1]["height"])+hh |
| | | |
| | | // 设置开始和技术点,两点确定一条直线 |
| | | let startPoint = Cesium.Cartesian3.fromDegrees(data[i]["lon"], data[i]["lat"], h1) |
| | | let endPoint = Cesium.Cartesian3.fromDegrees(data[i+1]["lon"], data[i+1]["lat"], h2) |
| | |
| | | hsaEdit:true, |
| | | hasHeightEdit:true |
| | | }) |
| | | arr_.push(map_name_) |
| | | // polinlayer1.addGraphic(map_name_) |
| | | floor_position_light2.push(map_name_) |
| | | } |
| | | } |
| | | function showHistoryPathDetail(itemname,itemid,itemfloor) { |
| | |
| | | name_ = new mars3d.layer.GraphicLayer({ |
| | | pid:155, |
| | | name:code, |
| | | show:true |
| | | show:false |
| | | }) |
| | | map.addLayer(name_) |
| | | for(let i=0;i<data.length;i++){ |
| | |
| | | var openfl = false; |
| | | var height_list = []; |
| | | initGraphic = new mars3d.layer.GraphicLayer({ |
| | | pid:155, |
| | | name:"路径", |
| | | // pid:155, |
| | | // name:"路径", |
| | | show:true |
| | | }) |
| | | map.addLayer(initGraphic) |
| | |
| | | |
| | | // 展开楼层 |
| | | $(".open2").click(function(e){ |
| | | |
| | | mr_rode() |
| | | console.log(floor_position_light,"展开前") |
| | | let point_arr = new_msisdn_list.length>0?new_msisdn_list:point_list |
| | | for(let i=0;i<point_arr.length;i++){ |
| | | let floor = point_arr[i].options.position[2]/3 |
| | | console.log(floor,"floor") |
| | | if(floor>1){ |
| | | point_arr[i].addDynamicPosition([point_arr[i].options.position[0],point_arr[i].options.position[1],point_arr[i].options.position[2]+15*(floor-1)]) |
| | | } |
| | |
| | | floor_position_light[i].remove() |
| | | } |
| | | for(let i=0;i<floor_position_light2.length;i++){ |
| | | polinlayer1.addGraphic(floor_position_light2[i]) |
| | | floor_position_light2[i].addTo(initGraphic) |
| | | } |
| | | |
| | | console.log(floor_position_light,"展开后") |
| | | }) |
| | | // 合并楼层 |
| | | $(".merge").click(function(){ |
| | |
| | | for(let i=0;i<floor_position_light.length;i++){ |
| | | floor_position_light[i].addTo(initGraphic) |
| | | } |
| | | polinlayer.options.show = true |
| | | }) |
| | | // 显示全部 |
| | | $(".hide_").click(function(){ |
| | |
| | | var button_button = $("button") |
| | | button_button.click(function(e){ |
| | | new_msisdn_list = [] |
| | | // console.log(new_msisdn_list,"opacity") |
| | | // 六楼以下楼层对应相应的按钮,六层时把五楼楼顶和六楼同时隐藏,六楼以上按钮对应到楼层加一 |
| | | $(this).addClass('red') |
| | | $(this).siblings('button').removeClass('red') |
| | |
| | | for(let i=0;i<point_list.length;i++){ |
| | | new_msisdn_list= [] |
| | | let floor = Number(point_list[i].options.position[2])/3 |
| | | // let floor_1 = Math.floor(floor) |
| | | // console.log(floor_end,floor) |
| | | if(floor_end < floor){ |
| | | point_list[i].setStyle({ |
| | | opacity:0, |
| | |
| | | } |
| | | for(let i=0;i<floor_position_light.length;i++){ |
| | | let floor = Number(floor_position_light[i].points[0]._alt)/3 |
| | | // console.log(floor,"floor") |
| | | if(floor_end < floor){ |
| | | floor_position_light[i].setStyle({ |
| | | width:0 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | console.log("完成") |
| | | |
| | | }) |
| | | |
| | |
| | | console.log("我在里面") |
| | | var evt=getEvent(); |
| | | var element=evt.srcElement || evt.target; |
| | | console.log(element.style.backgroundColor) |
| | | if (element.tagName=="TD"){ |
| | | console.log(element) |
| | | var bg=rgbToHex(element.style.backgroundColor); |
| | | for(let i=0;i<model_list.length;i++){ |
| | | model_list[i].setStyle({ |
| | |
| | | function addPciModel(){ |
| | | var PCI_position_layer = new mars3d.layer.GraphicLayer({ |
| | | pid:99, |
| | | name:'new_PCI', |
| | | name:'PCI', |
| | | show:false |
| | | }) |
| | | map.addLayer(PCI_position_layer) |
| | |
| | | datas_2.push(datas[i]) |
| | | } |
| | | let rru_end = unique(datas) |
| | | console.log(rru_end,"rru_end") |
| | | for(let i=0;i<rru_end.length;i++){ |
| | | let item = datas[i] |
| | | let coneGlow = new mars3d.graphic.CircleEntity({ |
| | |
| | | id: 104, |
| | | pid: 99, |
| | | name: "设备轨迹", |
| | | show: true, |
| | | show: false, |
| | | popup: "all", |
| | | flyTo: false |
| | | }); |
| | | |
| | | var ue_trace_layer_merge = new mars3d.layer.GraphicLayer({ |
| | | // type:'group', |
| | | id: 105, |
| | | pid: 104, |
| | | name: "合并后轨迹", |
| | | show: false, |
| | | popup: "all", |
| | | flyTo: false |
| | | }); |
| | | var ue_trace_layer_open = new mars3d.layer.GraphicLayer({ |
| | | // type:'group', |
| | | id: 106, |
| | | pid: 104, |
| | | name: "展开后轨迹", |
| | | show: false, |
| | | popup: "all", |
| | | flyTo: false |
| | | }); |
| | | map.addLayer(ue_trace_layer); |
| | | map.addLayer(ue_trace_layer_merge); |
| | | map.addLayer(ue_trace_layer_open); |
| | | |
| | | } |
| | | function testLight(){ |
| | | var testgraphic = new mars3d.layer.GraphicLayer({ |
| | | id: 104, |
| | | pid: 99, |
| | | name: "测试轨迹", |
| | | show: true, |
| | | flyTo: false |
| | | }); |
| | | map.addLayer(ue_trace_layer); |
| | | } |
| | | |
| | | |
| | | function addCustomLayers() { |
| | | addMsisdnPoint(); |
| | | addLightMr();//设备轨迹 |
| | | addLightMr(); |
| | | // testLight();//设备轨迹 |
| | | addPciModel();//PCI位置 |
| | | openFloor();//瑞金大楼 |
| | | addMockpoint();//设备定位点 |