cesium 加载kml polygon和mark(贴地形terrain效果)


key code:

var options = {
    camera : viewer.scene.camera,
    canvas : viewer.scene.canvas,
    clampToGround: true //开启贴地
};
viewer.camera.flyHome(0);
        var a = viewer.dataSources.add(Cesium.KmlDataSource.load('../data/kml/test_geojson_test.kml', options));
        a.then( viewer.flyTo(a));
        a.then(function(dataSource) {
            var entities = dataSource.entities.values;
           for (var i = 0; i < entities.length; i++) {
              var entity = entities[i];
         // 设置每个entity的样式    entity.billboard.disableDepthTestDistance
= Number.POSITIVE_INFINITY; //去掉地形遮挡   entity.billboard.color = Cesium.Color.WHITE;   entity.billboard.image = '../data/kml/img.jpg'; } });

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM