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()
|
}
|