赞
踩
##### entities(可添加 point、polyline、billboard、wall、model、polylineVolume等等)*添加点
```js
viewer.entities.add({
name:'',
position: Cesium.Cartesian3.fromDegrees(lon, lat,0),
point: {
show:true, //default
color: ,
pixelSize:15, //default: 1
outlineWidth: 0
//scaleByDistance: new Cesium.NearFarScalar(
//10,
//10,
//1200000,
//5
//)
}
})
```*添加线
```js//data = [lon1,lat1,h1,lon2,lat2,h2]
viewer.entities.add({
name :'line',
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights(data),
width :4,
material :this.getMaterial2(item, color)
}
})
```*添加图片 Billboard
```js
viewer.entities.add({
name:'',
position: Cesium.Cartesian3.fromDegrees(lon, lat, heights),
billboard: {
image:'/images/1.png',
width:300,
height:150,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: Cesium.HorizontalOrigin.LEFT
}
})
```*添加墙 Wall
```js
viewer.entities.add({
name:'',
wall: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(dataArr),//渐变色
material: newCesium.ImageMaterialProperty({//fe3b3c 10f7b0 fffd8f
//添加回调
image:
types== 1
?red1
: types== 2
?red11
: types== 3
?light4
: purple,
repeat:new Cesium.Cartesian2(50, 1.0),
transparent:true})//outlineColor: Cesium.Color.WHITE,
//outlineWidth: 30
//纯色
//material: colors,
} 添加其他属性
//properties: {
//name: v.name ? v.name : '--',
//address: v.address ? v.address : '--'
//}
})
```*添加实体
```js//将经纬度坐标转换为三维空间坐标
var position = Cesium.Cartesian3.fromDegrees(120, 27, 1000);var heading = Cesium.Math.toRadians(135);var pitch = Ce
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。