GisEyeGradientColorMaterialProperty

new GisEye.GisEyeGradientColorMaterialProperty(options)

颜色渐变纹理

Name Type Description
options object

入参对象

Name Type Default Description
color1 Cesium.Color Cesium.Color.WHITE optional

颜色1

color2 Cesium.Color Cesium.Color.BLACK optional

颜色2

orientation Number 1 optional

方向 1(左右) 2(上下) 3(左下右上) 4(左上右下)

repeatNum object {x: 1,y: 1} optional

重复数量(x、y代表方向)

alpha Number 1 optional

透明度

isTranslucent boolean true optional

是否透明

Example:
let lon = 104;
  let lat = 30;
  viewer.entities.add({
    polyline: {
      positions: Cesium.Cartesian3.fromDegreesArrayHeights([
      lon - 0.2 + 0.6, lat, 0.0,
      lon + 0.2 + 0.6, lat, 0.0,
      ]),
      width: 20.0,
      material: new GisEye.GisEyeGradientColorMaterialProperty({
        color1: new Cesium.Color(0.0, 0.0, 1.0, 1.0),
        color2: new Cesium.Color(1.0, 1.0, 0.0, 1.0),
        orientation: 1.0,
        repeatNum: {
          x:1,
          y:1
        },
        alpha:1,
        isTranslucent:true
      })
    }
  });
  viewer.entities.add({
    polyline: {
      positions: Cesium.Cartesian3.fromDegreesArrayHeights([
      lon - 0.2 + 0.6, lat-0.1, 0.0,
      lon + 0.2 + 0.6, lat-0.1, 0.0,
      ]),
      width: 20.0,
      material: new GisEye.GisEyeGradientColorMaterialProperty({
        color1: new Cesium.Color(0.0, 0.0, 1.0, 1.0),
        color2: new Cesium.Color(1.0, 1.0, 0.0, 1.0),
        orientation: 2.0,
        repeatNum: {
          x:1,
          y:1
        },
        alpha:1,
        isTranslucent:true
      })
    }
  });
  viewer.entities.add({
    polyline: {
      positions: Cesium.Cartesian3.fromDegreesArrayHeights([
      lon - 0.2 + 0.6, lat-0.2, 0.0,
      lon + 0.2 + 0.6, lat-0.2, 0.0,
      ]),
      width: 20.0,
      material: new GisEye.GisEyeGradientColorMaterialProperty({
        color1: new Cesium.Color(0.0, 0.0, 1.0, 1.0),
        color2: new Cesium.Color(1.0, 1.0, 0.0, 1.0),
        orientation: 3.0,
        repeatNum: {
          x:1,
          y:1
        },
        alpha:1,
        isTranslucent:true
      })
    }
  });
  viewer.entities.add({
    polyline: {
      positions: Cesium.Cartesian3.fromDegreesArrayHeights([
      lon - 0.2 + 0.6, lat-0.3, 0.0,
      lon + 0.2 + 0.6, lat-0.3, 0.0,
      ]),
      width: 20.0,
      material: new GisEye.GisEyeGradientColorMaterialProperty({
        color1: new Cesium.Color(0.0, 0.0, 1.0, 1.0),
        color2: new Cesium.Color(1.0, 1.0, 0.0, 1.0),
        orientation: 4.0,
        repeatNum: {
          x:1,
          y:1
        },
        alpha:1,
        isTranslucent:true
      })
    }
  });