| | |
| | | var graphicLayer17 |
| | | // import data from '../data/sites.js' |
| | | var get_JSON = { |
| | | ruijin_url:"http://localhost:4500/dataservice/Bdata?bid=" |
| | | ruijin_url:"http://localhost:4500/dataservice/Bdata?bid=" |
| | | } |
| | | // 页面初始化,创建楼层按键 |
| | | $(document).ready(function(){ |
| | | 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_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) |
| | | |
| | | |
| | | } |
| | | }) |
| | | |
| | | 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_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) |
| | | |
| | | |
| | | } |
| | | }) |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 调色盘相关事件 |
| | | var current=null |
| | | function getEvent(){ |
| | |
| | | } |
| | | func=getEvent.caller; |
| | | while(func!=null){ |
| | | var arg0=func.arguments[0]; |
| | | if(arg0){ |
| | | if((arg0.constructor==Event || arg0.constructor ==MouseEvent)||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)) |
| | | { |
| | | return arg0; |
| | | } |
| | | } |
| | | func=func.caller; |
| | | var arg0=func.arguments[0]; |
| | | if(arg0){ |
| | | if((arg0.constructor==Event || arg0.constructor ==MouseEvent)||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)) |
| | | { |
| | | return arg0; |
| | | } |
| | | } |
| | | func=func.caller; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | function doOver() { |
| | | var evt=getEvent(); |
| | | var element=evt.srcElement || evt.target; |
| | | var DisColor=document.getElementById("DisColor"); |
| | | var HexColor=document.getElementById("HexColor"); |
| | | if ((element.tagName=="TD") && (current!=element)) { |
| | | if (current!=null){ |
| | | current.style.backgroundColor = current._background |
| | | } |
| | | element._background = element.style.backgroundColor |
| | | DisColor.style.backgroundColor = rgbToHex(element.style.backgroundColor) |
| | | HexColor.value = rgbToHex(element.style.backgroundColor) |
| | | element.style.backgroundColor = "white" |
| | | current = element |
| | | if (current!=null){ |
| | | current.style.backgroundColor = current._background |
| | | } |
| | | element._background = element.style.backgroundColor |
| | | DisColor.style.backgroundColor = rgbToHex(element.style.backgroundColor) |
| | | HexColor.value = rgbToHex(element.style.backgroundColor) |
| | | element.style.backgroundColor = "white" |
| | | current = element |
| | | } |
| | | } |
| | | function rgbToHex(aa){ |
| | | if(aa.indexOf("rgb") != -1){ |
| | | aa=aa.replace("rgb(","") |
| | | aa=aa.replace(")","") |
| | | aa=aa.split(",") |
| | | r=parseInt(aa[0]); |
| | | g=parseInt(aa[1]); |
| | | b=parseInt(aa[2]); |
| | | r = r.toString(16); |
| | | if (r.length == 1) { r = '0' + r; } |
| | | g = g.toString(16); |
| | | if (g.length == 1) { g = '0' + g; } |
| | | b = b.toString(16); |
| | | if (b.length == 1) { b = '0' + b; } |
| | | return ("#" + r + g + b).toUpperCase(); |
| | | aa=aa.replace("rgb(","") |
| | | aa=aa.replace(")","") |
| | | aa=aa.split(",") |
| | | r=parseInt(aa[0]); |
| | | g=parseInt(aa[1]); |
| | | b=parseInt(aa[2]); |
| | | r = r.toString(16); |
| | | if (r.length == 1) { r = '0' + r; } |
| | | g = g.toString(16); |
| | | if (g.length == 1) { g = '0' + g; } |
| | | b = b.toString(16); |
| | | if (b.length == 1) { b = '0' + b; } |
| | | return ("#" + r + g + b).toUpperCase(); |
| | | }else{ |
| | | return aa; |
| | | return aa; |
| | | } |
| | | } |
| | | function showHistoryPathDetail(itemname,itemid,itemfloor) { |
| | | |
| | | |
| | | if (mars3d.widget.isActivate("widgets/rruRouterReplay/widget.js")) { |
| | | var detailWiget = mars3d.widget.getClass("widgets/rruRouterReplay/widget.js"); |
| | | detailWiget.reloadData({ |
| | | "id":itemid, |
| | | "name":itemname, |
| | | "floor":itemfloor |
| | | }); |
| | | "id":itemid, |
| | | "name":itemname, |
| | | "floor":itemfloor |
| | | }); |
| | | } else { |
| | | mars3d.widget.activate({ |
| | | uri: "widgets/rruRouterReplay/widget.js", |
| | | params: { |
| | | "id":itemid, |
| | | "name":itemname, |
| | | "floor":itemfloor |
| | | } |
| | | "id":itemid, |
| | | "name":itemname, |
| | | "floor":itemfloor |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 瑞金大楼的创建和对其进行的操作 |
| | | function openFloor(){ |
| | | var num = 0; |
| | | var openfl = false; |
| | | var height_list = []; |
| | | // 切换楼层颜色 |
| | | |
| | | // 调色板,用于调整大楼外部颜色 |
| | | |
| | | // 展开楼层 |
| | | $(".open2").click(function(e){ |
| | | for(let i = 1;i<model_list.length;i++){ |
| | | if(i<7){ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*i] |
| | | }) |
| | | }else{ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*(i-1)] |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | // 合并楼层 |
| | | $(".merge").click(function(){ |
| | | for(let i = 1;i<model_list.length;i++){ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]] |
| | | }) |
| | | } |
| | | }) |
| | | // 显示全部 |
| | | $(".hide_").click(function(){ |
| | | console.log(mr_points_list) |
| | | for(let i=0;i<model_list.length;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | }) |
| | | // 切换按钮,显示与隐藏调色盘 |
| | | $(".change").click(function(){ |
| | | $("#color_boxs").toggle(); |
| | | }) |
| | | // 选取按钮,点击按钮显示相应楼层 |
| | | 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') |
| | | let floor_ = e.target.className |
| | | // let floor_end = Number(floor_) |
| | | let floor_end = Number(floor_.slice(0,-3)) |
| | | for(let i=0;i<mr_points_list.length;i++){ |
| | | new_msisdn_list= [] |
| | | let floor = Number(mr_points_list[i].options.position[2])/3 |
| | | if(floor_end < floor){ |
| | | mr_points_list[i].setStyle({ |
| | | opacity:0, |
| | | label:{ |
| | | opacity:0 |
| | | } |
| | | }) |
| | | }else{ |
| | | mr_points_list[i].setStyle({ |
| | | opacity:1, |
| | | label:{ |
| | | opacity:1 |
| | | } |
| | | }) |
| | | } |
| | | new_mr_points_list.push(mr_points_list[i]) |
| | | } |
| | | |
| | | if(floor_end<7){ |
| | | |
| | | for(let i=1;i<floor_end+1;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | for(let j=floor_end;j<model_list.length;j++){ |
| | | model_list[j].show = false |
| | | } |
| | | |
| | | }else if(floor_end == 7){ |
| | | for(let i=1;i<8;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | for(let j=8;j<model_list.length;j++){ |
| | | model_list[j].show = false |
| | | } |
| | | }else{ |
| | | for(let i=1;i<floor_end+1;i++){ |
| | | model_list[i+1].show = true |
| | | } |
| | | for(let j=floor_end;j<model_list.length+1;j++){ |
| | | model_list[j+1].show = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | var model_lon = 121.462091; |
| | | var model_lat = 31.212238; |
| | | var heading_ = 165 |
| | | // 添加医院大楼模型 |
| | | const graphicLayer = new mars3d.layer.GraphicLayer({ |
| | | id: 203, |
| | | pid: 98, |
| | | name: "上海瑞金医院", |
| | | show: true, |
| | | flyTo:false |
| | | }) |
| | | map.addLayer(graphicLayer) |
| | | floorGraphic1 = new mars3d.graphic.ModelEntity({ |
| | | position: [model_lon, model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F1.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>一楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic2 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F2.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>二楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic3 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>三楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic4 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 2.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>四楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic5 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 5.6], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>五楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic6 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 8.4], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic7 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 1.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F5-roof.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>六楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic8 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -1.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>七楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic9 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 2.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>八楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic10 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic11 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 7.9], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic12 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 10.7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic13 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 13.5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic14 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 16.3], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic15 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 19.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic16 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 21.9], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | fill:true, |
| | | // opacity:0.7, |
| | | // color:"#ffffff", |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic17 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 24.7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic18 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic19 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -2], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic20 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic21 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 4], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic22 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic23 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 10], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic24 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -6.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | maximumScale:2, |
| | | url: "./gltf/Ruijin2/F22-roof.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | }) |
| | | model_list.push( |
| | | floorGraphic1, |
| | | floorGraphic2, |
| | | floorGraphic3, |
| | | floorGraphic4, |
| | | floorGraphic5, |
| | | floorGraphic6, |
| | | floorGraphic7, |
| | | floorGraphic8, |
| | | floorGraphic9, |
| | | floorGraphic10, |
| | | floorGraphic11, |
| | | floorGraphic12, |
| | | floorGraphic13, |
| | | floorGraphic14, |
| | | floorGraphic15, |
| | | floorGraphic16, |
| | | floorGraphic17, |
| | | floorGraphic18, |
| | | floorGraphic19, |
| | | floorGraphic20, |
| | | floorGraphic21, |
| | | floorGraphic22, |
| | | floorGraphic23, |
| | | floorGraphic24, |
| | | ) |
| | | |
| | | for(let i = 0;i<model_list.length;i++){ |
| | | graphicLayer.addGraphic(model_list[i]) |
| | | } |
| | | if(model_list.length>0){ |
| | | var ColorHex=new Array('00','33','66','99','CC','FF') |
| | | var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF') |
| | | |
| | | |
| | | var colorTable='' |
| | | for (i=0;i<2;i++) //循环2部分 |
| | | { |
| | | for (j=0;j<6;j++) //循环6行 |
| | | { |
| | | colorTable=colorTable+'<tr height=12>' |
| | | for (k=0;k<3;k++) |
| | | { |
| | | for (l=0;l<6;l++) |
| | | { |
| | | colorTable=colorTable+'<td onclick="test_box()" class="color_box" width=11 style="background-color:#'+ColorHex[k+i*3]+ColorHex[l]+ColorHex[j]+'">' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | colorTable='<table id="color_fbox" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" style="cursor:hand;">' |
| | | +colorTable+'</table>'; |
| | | colorpanel.innerHTML=colorTable |
| | | } |
| | | |
| | | |
| | | var num = 0; |
| | | var openfl = false; |
| | | var height_list = []; |
| | | // 切换楼层颜色 |
| | | |
| | | // 调色板,用于调整大楼外部颜色 |
| | | |
| | | // 展开楼层 |
| | | $(".open2").click(function(e){ |
| | | for(let i = 1;i<model_list.length;i++){ |
| | | if(i<7){ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*i] |
| | | }) |
| | | }else{ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*(i-1)] |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | // 合并楼层 |
| | | $(".merge").click(function(){ |
| | | for(let i = 1;i<model_list.length;i++){ |
| | | model_list[i].moveTo({ |
| | | position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]] |
| | | }) |
| | | } |
| | | }) |
| | | // 显示全部 |
| | | $(".hide_").click(function(){ |
| | | console.log(mr_points_list) |
| | | for(let i=0;i<model_list.length;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | }) |
| | | // 切换按钮,显示与隐藏调色盘 |
| | | $(".change").click(function(){ |
| | | $("#color_boxs").toggle(); |
| | | }) |
| | | // 选取按钮,点击按钮显示相应楼层 |
| | | 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') |
| | | let floor_ = e.target.className |
| | | // let floor_end = Number(floor_) |
| | | let floor_end = Number(floor_.slice(0,-3)) |
| | | for(let i=0;i<mr_points_list.length;i++){ |
| | | new_msisdn_list= [] |
| | | let floor = Number(mr_points_list[i].options.position[2])/3 |
| | | if(floor_end < floor){ |
| | | mr_points_list[i].setStyle({ |
| | | opacity:0, |
| | | label:{ |
| | | opacity:0 |
| | | } |
| | | }) |
| | | }else{ |
| | | mr_points_list[i].setStyle({ |
| | | opacity:1, |
| | | label:{ |
| | | opacity:1 |
| | | } |
| | | }) |
| | | } |
| | | new_mr_points_list.push(mr_points_list[i]) |
| | | } |
| | | |
| | | if(floor_end<7){ |
| | | |
| | | for(let i=1;i<floor_end+1;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | for(let j=floor_end;j<model_list.length;j++){ |
| | | model_list[j].show = false |
| | | } |
| | | |
| | | }else if(floor_end == 7){ |
| | | for(let i=1;i<8;i++){ |
| | | model_list[i].show = true |
| | | } |
| | | for(let j=8;j<model_list.length;j++){ |
| | | model_list[j].show = false |
| | | } |
| | | }else{ |
| | | for(let i=1;i<floor_end+1;i++){ |
| | | model_list[i+1].show = true |
| | | } |
| | | for(let j=floor_end;j<model_list.length+1;j++){ |
| | | model_list[j+1].show = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | var model_lon = 121.462091; |
| | | var model_lat = 31.212238; |
| | | var heading_ = 165 |
| | | // 添加医院大楼模型 |
| | | const graphicLayer = new mars3d.layer.GraphicLayer({ |
| | | id: 203, |
| | | pid: 98, |
| | | name: "上海瑞金医院", |
| | | show: true, |
| | | flyTo:false |
| | | }) |
| | | map.addLayer(graphicLayer) |
| | | floorGraphic1 = new mars3d.graphic.ModelEntity({ |
| | | position: [model_lon, model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F1.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>一楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic2 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F2.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>二楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic3 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 0], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>三楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic4 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 2.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>四楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic5 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 5.6], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>五楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic6 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 8.4], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | distanceDisplayCondition_far:100, |
| | | url: "./gltf/Ruijin2/F3-5.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic7 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 1.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F5-roof.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>六楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic8 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -1.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>七楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic9 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 2.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | popup:`<p>八楼</p>`, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic10 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic11 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 7.9], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic12 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 10.7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic13 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 13.5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic14 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 16.3], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic15 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 19.1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic16 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 21.9], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | fill:true, |
| | | // opacity:0.7, |
| | | // color:"#ffffff", |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic17 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 24.7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/F7-16.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic18 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -5], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic19 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -2], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic20 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 1], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic21 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 4], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic22 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 7], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic23 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, 10], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | url: "./gltf/Ruijin2/L17_220303.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | rotation:{x:0,y:0,z:180} |
| | | }) |
| | | floorGraphic24 = new mars3d.graphic.ModelEntity({ |
| | | |
| | | position: [model_lon,model_lat, -6.8], // 楼栋位置 |
| | | style: { |
| | | scale:1, |
| | | maximumScale:2, |
| | | url: "./gltf/Ruijin2/F22-roof.gltf", |
| | | heading: heading_, |
| | | color:"#ffff00", |
| | | fill:true |
| | | }, |
| | | }) |
| | | model_list.push( |
| | | floorGraphic1, |
| | | floorGraphic2, |
| | | floorGraphic3, |
| | | floorGraphic4, |
| | | floorGraphic5, |
| | | floorGraphic6, |
| | | floorGraphic7, |
| | | floorGraphic8, |
| | | floorGraphic9, |
| | | floorGraphic10, |
| | | floorGraphic11, |
| | | floorGraphic12, |
| | | floorGraphic13, |
| | | floorGraphic14, |
| | | floorGraphic15, |
| | | floorGraphic16, |
| | | floorGraphic17, |
| | | floorGraphic18, |
| | | floorGraphic19, |
| | | floorGraphic20, |
| | | floorGraphic21, |
| | | floorGraphic22, |
| | | floorGraphic23, |
| | | floorGraphic24, |
| | | ) |
| | | |
| | | for(let i = 0;i<model_list.length;i++){ |
| | | graphicLayer.addGraphic(model_list[i]) |
| | | } |
| | | if(model_list.length>0){ |
| | | var ColorHex=new Array('00','33','66','99','CC','FF') |
| | | var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF') |
| | | |
| | | |
| | | var colorTable='' |
| | | for (i=0;i<2;i++) //循环2部分 |
| | | { |
| | | for (j=0;j<6;j++) //循环6行 |
| | | { |
| | | colorTable=colorTable+'<tr height=12>' |
| | | for (k=0;k<3;k++) |
| | | { |
| | | for (l=0;l<6;l++) |
| | | { |
| | | colorTable=colorTable+'<td onclick="test_box()" class="color_box" width=11 style="background-color:#'+ColorHex[k+i*3]+ColorHex[l]+ColorHex[j]+'">' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | colorTable='<table id="color_fbox" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" style="cursor:hand;">' |
| | | +colorTable+'</table>'; |
| | | colorpanel.innerHTML=colorTable |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // 计算高度 |
| | | function finalHeight(h){ |
| | | let h1 = Number(h) |
| | | let h2 = 0 |
| | | let h3 = 0 |
| | | let h4 = 0 |
| | | let h5 = 0 |
| | | if(h1<=4.5){ |
| | | h5 = 1 |
| | | }else{ |
| | | h2 = h1-4.5-1 |
| | | h3 = h2/2.8 |
| | | h4 = Math.floor(h3)+2 |
| | | h5 = h4*3 |
| | | } |
| | | |
| | | return h5 |
| | | let h1 = Number(h) |
| | | let h2 = 0 |
| | | let h3 = 0 |
| | | let h4 = 0 |
| | | let h5 = 0 |
| | | if(h1<=4.5){ |
| | | h5 = 1 |
| | | }else{ |
| | | h2 = h1-4.5-1 |
| | | h3 = h2/2.8 |
| | | h4 = Math.floor(h3)+2 |
| | | h5 = h4*3 |
| | | } |
| | | |
| | | return h5 |
| | | } |
| | | |
| | | |
| | | // 添加PCI模型 |
| | | function addPciModel(){ |
| | | var PCI_position_layer = new mars3d.layer.GraphicLayer({ |
| | | pid:99, |
| | | name:'new_PCI', |
| | | show:false |
| | | }) |
| | | map.addLayer(PCI_position_layer) |
| | | $.ajax({ |
| | | type:'get', |
| | | dataType:'json', |
| | | async:true, |
| | | url:get_JSON.ruijin_url+'get_rru_info', |
| | | success:function(data){ |
| | | var datas_2 = [] |
| | | let datas = data.data.data |
| | | for(let i=0;i<datas.length;i++){ |
| | | 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({ |
| | | position: Cesium.Cartesian3.fromDegrees(Number(item.Longitude),Number(item.Latitude),0), |
| | | style: { |
| | | color:'rgba(255, 254, 253, 1.0)', |
| | | radius: 4, |
| | | diffHeight:Number(item.AntHight) |
| | | }, |
| | | popup:`<p>名称:${item.SitenameCN}</p> |
| | | <p>地址:${item.SiteAddress}</p> |
| | | <p>编号:${item.eNodeBID}</p> |
| | | <p>经度:${item.Longitude}</p> |
| | | <p>纬度:${item.Latitude}</p> |
| | | <p>高度:${item.AntHight}</p>`, |
| | | show:true |
| | | }) |
| | | PCI_position_layer.addGraphic(coneGlow) |
| | | } |
| | | for(let i=0;i<datas_2.length;i++){ |
| | | let item = datas_2[i] |
| | | for(let j=0;j<rru_end.length;j++){ |
| | | if(item.SitenameCN == rru_end[j].SitenameCN||item.SiteAddress === rru_end[j].SiteAddress){ |
| | | item.Longitude = rru_end[j].Longitude |
| | | item.Latitude = rru_end[j].Latitude |
| | | item.AntHight = rru_end[j].AntHight |
| | | let num = Number(item.DirectionalAngle) |
| | | let plane_pci |
| | | let h = Number(item.AntHight) |
| | | if(item.frequencyRange == '1.8G'){ |
| | | plane_pci = addPCIPlane(item,h-7,num,"#ff0000") |
| | | }else if(item.frequencyRange == '2.1G'){ |
| | | plane_pci = addPCIPlane(item,h+7,num,"#00ff00") |
| | | }else{ |
| | | plane_pci = addPCIPlane(item,h,num,"#0000ff") |
| | | } |
| | | PCI_position_layer.addGraphic(plane_pci) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }, |
| | | error: function (request, textStatus) { |
| | | |
| | | } |
| | | }) |
| | | var PCI_position_layer = new mars3d.layer.GraphicLayer({ |
| | | pid:99, |
| | | name:'new_PCI', |
| | | show:false |
| | | }) |
| | | map.addLayer(PCI_position_layer) |
| | | $.ajax({ |
| | | type:'get', |
| | | dataType:'json', |
| | | async:true, |
| | | url:get_JSON.ruijin_url+'get_rru_info', |
| | | success:function(data){ |
| | | var datas_2 = [] |
| | | let datas = data.data.data |
| | | for(let i=0;i<datas.length;i++){ |
| | | 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({ |
| | | position: Cesium.Cartesian3.fromDegrees(Number(item.Longitude),Number(item.Latitude),0), |
| | | style: { |
| | | color:'rgba(255, 254, 253, 1.0)', |
| | | radius: 4, |
| | | diffHeight:Number(item.AntHight) |
| | | }, |
| | | popup:`<p>名称:${item.SitenameCN}</p> |
| | | <p>地址:${item.SiteAddress}</p> |
| | | <p>编号:${item.eNodeBID}</p> |
| | | <p>经度:${item.Longitude}</p> |
| | | <p>纬度:${item.Latitude}</p> |
| | | <p>高度:${item.AntHight}</p>`, |
| | | show:true |
| | | }) |
| | | PCI_position_layer.addGraphic(coneGlow) |
| | | } |
| | | for(let i=0;i<datas_2.length;i++){ |
| | | let item = datas_2[i] |
| | | for(let j=0;j<rru_end.length;j++){ |
| | | if(item.SitenameCN == rru_end[j].SitenameCN||item.SiteAddress === rru_end[j].SiteAddress){ |
| | | item.Longitude = rru_end[j].Longitude |
| | | item.Latitude = rru_end[j].Latitude |
| | | item.AntHight = rru_end[j].AntHight |
| | | let num = Number(item.DirectionalAngle) |
| | | let plane_pci |
| | | let h = Number(item.AntHight) |
| | | if(item.frequencyRange == '1.8G'){ |
| | | plane_pci = addPCIPlane(item,h-7,num,"#ff0000") |
| | | }else if(item.frequencyRange == '2.1G'){ |
| | | plane_pci = addPCIPlane(item,h+7,num,"#00ff00") |
| | | }else{ |
| | | plane_pci = addPCIPlane(item,h,num,"#0000ff") |
| | | } |
| | | PCI_position_layer.addGraphic(plane_pci) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }, |
| | | error: function (request, textStatus) { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 封装方法,将rru_info获取到的宏站数据去重 |
| | | function unique(arr) { |
| | | for ( var i = 0, len = arr.length; i < len; i++ ) { |
| | | for ( var j = i + 1, len = arr.length; j < len; j++ ) { |
| | | if (arr[i].SitenameCN === arr[j].SitenameCN||arr[i].SiteAddress === arr[j].SiteAddress) { |
| | | arr.splice(j, 1 ); |
| | | j --; //每刪除一個數j的值就減1 |
| | | len--; // j值減小時len也要相應減1(減少循環次數,節省性能) |
| | | // console.log(j,len) |
| | | |
| | | } |
| | | } |
| | | } |
| | | return arr; |
| | | for ( var i = 0, len = arr.length; i < len; i++ ) { |
| | | for ( var j = i + 1, len = arr.length; j < len; j++ ) { |
| | | if (arr[i].SitenameCN === arr[j].SitenameCN||arr[i].SiteAddress === arr[j].SiteAddress) { |
| | | arr.splice(j, 1 ); |
| | | j --; //每刪除一個數j的值就減1 |
| | | len--; // j值減小時len也要相應減1(減少循環次數,節省性能) |
| | | // console.log(j,len) |
| | | |
| | | } |
| | | } |
| | | } |
| | | return arr; |
| | | } |
| | | |
| | | |
| | | // 调色盘网格点击事件,点击到的颜色对大楼模型颜色进行改变 |
| | | function test_box(){ |
| | | console.log("我在外边") |
| | | doclick() |
| | | } |
| | | console.log("我在外边") |
| | | doclick() |
| | | } |
| | | function doclick(){ |
| | | 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({ |
| | | color:bg, |
| | | fill:true, |
| | | shadows:Cesium.ShadowMode.ENABLED, |
| | | colorBlendMode:Cesium.ColorBlendMode.HIGHLIGHT, |
| | | colorBlendAmountEnabled : true , |
| | | colorBlendAmount:0.8 |
| | | }) |
| | | } |
| | | return bg; |
| | | } |
| | | } |
| | | |
| | | |
| | | 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({ |
| | | color:bg, |
| | | fill:true, |
| | | shadows:Cesium.ShadowMode.ENABLED, |
| | | colorBlendMode:Cesium.ColorBlendMode.HIGHLIGHT, |
| | | colorBlendAmountEnabled : true , |
| | | colorBlendAmount:0.8 |
| | | }) |
| | | } |
| | | return bg; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 添加宏站外的PCI,以面的形式展现 |
| | | function addPCIPlane(item,h,heading,color){ |
| | | const primitive = new mars3d.graphic.PlaneEntity({ |
| | | |
| | | position: [Number(item.Longitude),Number(item.Latitude),h], |
| | | style: { |
| | | plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X,10.0), |
| | | // plane_normal: , |
| | | heading:heading, |
| | | dimensions_x: 3.0, |
| | | dimensions_y: 6.0, |
| | | color: color, |
| | | opacity: 0.4, |
| | | |
| | | // 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用 |
| | | highlight: { |
| | | opacity: 0.9 |
| | | }, |
| | | |
| | | }, |
| | | popup:`<p>PCI:${item.PCI}</p> |
| | | <p>Sitename:${item.SitenameCN}</p> |
| | | <p>信号:${item.frequencyRange}</p> |
| | | <p>???:${item.EARFCN}</p> |
| | | `, |
| | | description:"文字" |
| | | }) |
| | | // PCI_position_layer.addGraphic(primitive) |
| | | return primitive |
| | | const primitive = new mars3d.graphic.PlaneEntity({ |
| | | |
| | | position: [Number(item.Longitude),Number(item.Latitude),h], |
| | | style: { |
| | | plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X,10.0), |
| | | // plane_normal: , |
| | | heading:heading, |
| | | dimensions_x: 3.0, |
| | | dimensions_y: 6.0, |
| | | color: color, |
| | | opacity: 0.4, |
| | | |
| | | // 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用 |
| | | highlight: { |
| | | opacity: 0.9 |
| | | }, |
| | | |
| | | }, |
| | | popup:`<p>PCI:${item.PCI}</p> |
| | | <p>Sitename:${item.SitenameCN}</p> |
| | | <p>信号:${item.frequencyRange}</p> |
| | | <p>???:${item.EARFCN}</p> |
| | | `, |
| | | description:"文字" |
| | | }) |
| | | // PCI_position_layer.addGraphic(primitive) |
| | | return primitive |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 添加设备定位点 |
| | | function addMrPosition(){ |
| | | var mr_position_graphic = new mars3d.layer.GraphicLayer({ |
| | | pid:90, |
| | | name:'设备定位', |
| | | show:false |
| | | }) |
| | | map.addLayer(mr_position_graphic) |
| | | $.ajax({ |
| | | type:'get', |
| | | dataType:'json', |
| | | async:true, |
| | | url:'http://localhost:4500/dataservice/Bdata?bid=get_mr_correted', |
| | | success:function(data){ |
| | | let datas = data.data.data |
| | | console.log(data.data.data,"获取数据") |
| | | for(let i=0;i<datas.length;i++){ |
| | | let item = datas[i] |
| | | let height = finalHeight(Number(item.corr_height)) |
| | | var map_name_ = new mars3d.graphic.BillboardEntity({ |
| | | position: [Number(item.corr_lon), Number(item.corr_lat),height], // 楼栋位置 |
| | | // position:[121.4623922,31.212190342686533,height], |
| | | style: { |
| | | image: 'img/end.png', |
| | | scale:0.5, |
| | | opacity:1, |
| | | scaleByDistance_far:500, |
| | | distanceDisplayCondition_far:500, |
| | | scaleByDistance_farValue:0.5, |
| | | scaleByDistance:true, |
| | | visibleDepth:true, |
| | | hasPixelOffset:false, |
| | | distanceDisplayCondition:true, |
| | | label:{ |
| | | text:item.index_, |
| | | color:"#ffff00", |
| | | font_size: 15, |
| | | pixelOffsetY: -20, |
| | | distanceDisplayCondition: true, |
| | | distanceDisplayCondition_far: 1500, |
| | | distanceDisplayCondition_near: 0 |
| | | } |
| | | }, |
| | | popup:"编号:" + |
| | | item["msisdn"] + |
| | | "<br />时间:" + |
| | | item["id"] + |
| | | "<br />名称:" + |
| | | item["name_"] + |
| | | "<br/><p><a href='#' onclick='javascript:showHistoryPathDetail(" + item["msisdn"] + ",\"" + item["name_"] + "\",\"" + item["height"] + "\")' >轨迹查询</a></p>" |
| | | }) |
| | | mr_points_list.push(map_name_) |
| | | mr_position_graphic.addGraphic(map_name_) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | var mr_position_graphic = new mars3d.layer.GraphicLayer({ |
| | | pid:90, |
| | | name:'设备定位', |
| | | show:false |
| | | }) |
| | | map.addLayer(mr_position_graphic) |
| | | $.ajax({ |
| | | type:'get', |
| | | dataType:'json', |
| | | async:true, |
| | | url:'http://localhost:4500/dataservice/Bdata?bid=get_mr_correted', |
| | | success:function(data){ |
| | | let datas = data.data.data |
| | | console.log(data.data.data,"获取数据") |
| | | for(let i=0;i<datas.length;i++){ |
| | | let item = datas[i] |
| | | let height = finalHeight(Number(item.corr_height)) |
| | | var map_name_ = new mars3d.graphic.BillboardEntity({ |
| | | position: [Number(item.corr_lon), Number(item.corr_lat),height], // 楼栋位置 |
| | | // position:[121.4623922,31.212190342686533,height], |
| | | style: { |
| | | image: 'img/end.png', |
| | | scale:0.5, |
| | | opacity:1, |
| | | scaleByDistance_far:500, |
| | | distanceDisplayCondition_far:500, |
| | | scaleByDistance_farValue:0.5, |
| | | scaleByDistance:true, |
| | | visibleDepth:true, |
| | | hasPixelOffset:false, |
| | | distanceDisplayCondition:true, |
| | | label:{ |
| | | text:item.index_, |
| | | color:"#ffff00", |
| | | font_size: 15, |
| | | pixelOffsetY: -20, |
| | | distanceDisplayCondition: true, |
| | | distanceDisplayCondition_far: 1500, |
| | | distanceDisplayCondition_near: 0 |
| | | } |
| | | }, |
| | | popup:"编号:" + |
| | | item["msisdn"] + |
| | | "<br />时间:" + |
| | | item["id"] + |
| | | "<br />名称:" + |
| | | item["name_"] + |
| | | "<br/><p><a href='#' onclick='javascript:showHistoryPathDetail(" + item["msisdn"] + ",\"" + item["name_"] + "\",\"" + item["height"] + "\")' >轨迹查询</a></p>" |
| | | }) |
| | | mr_points_list.push(map_name_) |
| | | mr_position_graphic.addGraphic(map_name_) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | function addpoint17(){ |
| | | graphicLayer17 = new mars3d.layer.GraphicLayer() |
| | | map.addLayer(graphicLayer17) |
| | | |
| | | |
| | | graphicLayer17 = new mars3d.layer.GraphicLayer() |
| | | map.addLayer(graphicLayer17) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | function addCustomLayers() { |
| | | addPciModel();//PCI位置 |
| | | openFloor();//瑞金大楼 |
| | | addMrPosition();//设备定位点 |
| | | addpoint17(); |
| | | } |
| | | addPciModel();//PCI位置 |
| | | openFloor();//瑞金大楼 |
| | | addMrPosition();//设备定位点 |
| | | addpoint17(); |
| | | } |