- Implements:
Example:
//定义盒
var graphicsBox = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
position: { x: 109.0, y: 25.0, z: 100000 },
box: { x: 100000, y: 100000, z: 100000 }
});
//定义圆
var graphicsCircle = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
position: { x: 109.0, y: 25.0, z: 100000 },
circle: { radius: 100000}
});
//定义圆球
var graphicsSphere = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
position: { x: 109.0, y: 25.0, z: 100000 },
sphere: { radius: 100000, slices:64}
});
//定义椭球
var graphicsEllipsoid = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
position: { x: 109.0, y: 25.0, z: 100000 },
ellipsoid: { radius: 100000, slices:64}
});
//定义圆柱
var graphicsCylinder = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
position: { x: 109.0, y: 25.0, z: 100000 },
cylinder: { length: 200000, topRadius: 80000, bottomRadius: 200000}
});
//定义矩形
var graphicsRect = new YS.Graphics({
color: { r: 1, g: 0, b: 1, a: 1 },
rect: {
rectangle: { west: 100, east: 102, north: 27, south: 25 },
height: 80000
}
});
//定义三角形
var graphicsTrangle = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
trangle: {
points: [
{ x: 110, y: 20, z: 100000 },
{ x: 112, y: 23, z: 100000 },
{ x: 114, y: 19, z: 100000 },
]
},
topmost: true
});
//定义直线
var graphicsLine = new YS.Graphics({
color: { r: 0, g: 1, b: 1, a: 1 },
line: {
p1: { x: 110, y: 25, z: 100000 },
p2: { x: 125, y: 27, z: 100000 },
width: 4
}
});
//定义折线
var graphicsPolyLine = new Graphics({
alongGround: true,
color: { r: 0, g: 1, b: 1, a: 1 },
polyline: {
points: [
{ x: 110, y: 22, z: 100000 },
{ x: 112, y: 23, z: 100000 },
{ x: 114.5, y: 19, z: 100000 },
{ x: 118, y: 25, z: 100000 },
{ x: 115, y: 23, z: 100000 }
]
},
width: 4
});