GeoPolygonClippingEffect

new Cesium.GeoPolygonClippingEffect(options)

多边形裁剪效果
Name Type Description
options Object 参数选项:
Name Type Description
viewer Viewer
clipResult Number 裁剪效果 0:Hide 1:Show
enabled Boolean 是否激活
isTriangle Boolean 输入的边界是三角形集合,亦或多边形集合
polygons Array 输入的边界集合
maskColor Color 裁剪区颜色
Example:
//三角形集合
var triangles = [//array
     [//triangle1
         [108.95871524500146,34.218802671399914],
         [108.95986897095226,34.21867666402208],
         [108.95946919091759,34.21927968145207]
     ],
     [//triangle2
         [108.96015087048974,34.21978626859701],
         [108.96063015757717,34.22082202787637],
         [108.958922335083,34.2210653592583]
     ]
 ];

 var effect = new Cesium.GeoPolygonClippingEffect({
     viewer: viewer,
     polygons: triangles,
     isTriangle: true
 });

 viewer.scene.primitives.add(effect);

//任意多边形集合
var polygons = [
     [//多边形1
         [//外环
             [108.95806470198664,34.21805040847296],
             [108.9594995661021,34.21906815289008],
             [108.96065684894059,34.218016739319374],
             [108.96079150357883,34.220956646348604],
             [108.95942470580154,34.2202856188371],
             [108.9582902733644,34.220788686417954]
         ],
         [//内环
             [108.96031308736131,34.22034994482614],
             [108.96040169396053,34.21911233177312],
             [108.95983607928989,34.21932298326818],
             [108.95984476194361,34.21992580097016]
         ]
     ]
 ];

 var effect = new Cesium.GeoPolygonClippingEffect({
     viewer: viewer,
     polygons: polygons
 });

 viewer.scene.primitives.add(effect);
Demo:

Members

staticreadonlyCesium.GeoPolygonClippingEffect.Hide : Number

隐藏裁剪样式

staticreadonlyCesium.GeoPolygonClippingEffect.Show : Number

显示裁剪样式

clipResult : Number

裁剪样式

enabled : Boolean

是否激活