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'; } });