master
2022-03-21 1292f810644e422357734d1616761eb920903f45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
var graphicLayer
var graphicLayer17
var points17 = []
// 页面初始化,创建楼层按键
$(document).ready(function(){
    $.ajax({
        type:'get',
        dataType:'json',
        async:true,
        url:'http://localhost:4500/dataservice/Bdata?bid=get_ruijin_outside&floor_=1',
        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] 
            }
            // console.log(points)
                
            
            const graphic = new mars3d.graphic.WallEntity({
              positions:points17,
              style: {
                closure: true,
                diffHeight: 2,
                // 动画线材质
                // material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.LineFlow, {
                //   image: "../img/textures/fence.png",
                //   color: "#00ff00",
                //   speed: 2,
                //   axisY: true
                // })
              },
              attr: { remark: "示例13" }
            })
            graphicLayer.addGraphic(graphic)
            
            
        }
    })
    // $.getJSON('data/ruijin_new_2.json',(result)=>{
        
        
    // })
 
    
})
// 
 
function addpoint(){
    graphicLayer17 = new mars3d.layer.GraphicLayer()
    map.addLayer(graphicLayer17)
    $.getJSON('data/one_one.json',(result)=>{
        console.log(result.data,"data")
        let datas = result.data
        for(let i=0;i<datas.length;i++){
            let item = datas[i]
            const graphic = new mars3d.graphic.PointEntity({
              position: [item.lon,item.lat],
              style: {
                color: "#003da6",
                outline: true,
                outlineColor: "#bfbfbf",
                outlineWidth: 2,
                horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                visibleDepth: false
              },
              attr: { remark: "示例1" }
            })
            graphicLayer17.addGraphic(graphic)
        }
        })
        $.getJSON('data/one_two.json',(result)=>{
            console.log(result.data,"data")
            let datas = result.data
            for(let i=0;i<datas.length;i++){
                let item = datas[i]
                const graphic = new mars3d.graphic.PointEntity({
                  position: [item.lon,item.lat],
                  style: {
                    color: "#0ff0f6",
                    outline: true,
                    outlineColor: "#bfbfbf",
                    outlineWidth: 2,
                    horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                    verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                    visibleDepth: false
                  },
                  attr: { remark: "示例1" }
                })
                graphicLayer17.addGraphic(graphic)
            }
            })
    
    
      
}
function addPoints(){
    graphicLayer = new mars3d.layer.GraphicLayer()
    map.addLayer(graphicLayer)
    
}
 
 
 
 
function addCustomLayers() {
    addpoint()
        addPoints()
}